Forum Moderators: open

Message Too Old, No Replies

Which ActiveX Object can R/W binary files?

FileSystemObject can only deal with text.

         

affter333

8:40 pm on Sep 10, 2003 (gmt 0)



Hi, I'm able to use javascript's FileSystemObject
to read a txt file, and post it to the web using HTTP-Post.

But is there a way to read binary files like jpegs so that
I can escape the data and upload it using HTTP-post method.
(not via file upload)

Thanks for your kind help..

bcolflesh

8:51 pm on Sep 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Working on an IIS server? The ASP FSO can read binary files.

Zaphod Beeblebrox

11:37 am on Sep 12, 2003 (gmt 0)

10+ Year Member



For example:


Dim objStream
Set objStream = Server.CreateObject("ADODB.Stream")
'Open a GIF file
objStream.Type = adTypeBinary
objStream.Open
objStream.LoadFromFile(Server.Mappath("/sendme.gif"))
'Output the contents of the stream object
Response.ContentType = "image/gif"
Response.BinaryWrite objStream.Read
objStream.Close
Set objStream = Nothing