How to convert JPEG image into a binary data?

Discussion in 'ASP .Net Security' started by Lucas Cowald, Oct 15, 2003.

  1. Lucas Cowald

    Lucas Cowald Guest

    Hi,

    Using ASP and VBScript. How to convert JPEG image into a binary data? Is it
    possible with a command from ASP / VBScript without having to put it into a
    database first?

    I want to take the JPEG image from a folder, convert it into a binary data,
    and stream it to the browser. How can I do it? Can you show a short code?

    Thank you for your help.
     
    Lucas Cowald, Oct 15, 2003
    #1
    1. Advertising

  2. Lucas Cowald

    Steve Jansen Guest

    Check out the documentation for the Scripting.FileSystemObject COM object.
    This will allow you to open and read binary objects.

    You can then set the mime type to "image/jpeg" with the Response.ContentType
    property and use the Response.BinaryWrite() method to write the stream from
    the FSO objects to the client.

    The only real reason to do this is to perform forms-based authenication
    before serving a binary file. If you want to protect the file with the
    aforementioned technique, remember to locate the files outside your web root
    or deny IIS read permissions on the JPEG folder/files.

    - Steve Jansen

    "Lucas Cowald" <> wrote in message
    news:...
    > Hi,
    >
    > Using ASP and VBScript. How to convert JPEG image into a binary data? Is

    it
    > possible with a command from ASP / VBScript without having to put it into

    a
    > database first?
    >
    > I want to take the JPEG image from a folder, convert it into a binary

    data,
    > and stream it to the browser. How can I do it? Can you show a short code?
    >
    > Thank you for your help.
    >
    >
     
    Steve Jansen, Oct 15, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lucas Cowald
    Replies:
    2
    Views:
    21,869
    Steve C. Orr [MVP, MCSD]
    Oct 15, 2003
  2. Lucas Cowald

    How to convert JPEG image into a binary data?

    Lucas Cowald, Oct 15, 2003, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    339
    Victor Garcia Aprea [MVP]
    Oct 19, 2003
  3. Lucas Cowald

    How to convert JPEG image into a binary data?

    Lucas Cowald, Oct 15, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    199
    Lucas Cowald
    Oct 15, 2003
  4. Lucas Cowald

    How to convert JPEG image into a binary data?

    Lucas Cowald, Oct 15, 2003, in forum: ASP .Net Mobile
    Replies:
    0
    Views:
    160
    Lucas Cowald
    Oct 15, 2003
  5. Lucas Cowald

    How to convert JPEG image into a binary data?

    Lucas Cowald, Oct 15, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    452
    Jan Limpens
    Oct 15, 2003
Loading...

Share This Page