How can i save BinaryRead string...

G

garbriel

hi!
i have a situation here!

i want to save string from BinaryRead()method, so i write
a ASP code just like that!!

<%
dim binRead
dim byteCount

byteCount= Request.TotalBytes
binRead = Request.BinaryRead(byteCount)
Set objFSO = Server.CreateObject
("Scripting.FileSystemObject")
Set objTStream = objFSO.CreateTextFile("C:\aaaa.txt", True)
objTStream.WriteLine binRead
Set obj = Nothing
%>

objTStream.WriteLine binRead <-- is it right?

when i open "C:\aaaa.txt" there is no char! no string

what is wrong?

how can i save binary string?

please!! i need your help
 
E

Egbert Nierop \(MVP for IIS\)

garbriel said:
hi!
i have a situation here!

i want to save string from BinaryRead()method, so i write
a ASP code just like that!!

<%
dim binRead
dim byteCount

byteCount= Request.TotalBytes
binRead = Request.BinaryRead(byteCount)
Set objFSO = Server.CreateObject

myChunk = Request.BinaryRead(byteCount)
Set myStream = CreateObject("ADODB.Stream")
myStream.Open
myStream.Type = 1 ' binary
myStream.Write(myChunk)
myStream.SaveToFile(yourfile)
myStream.Close
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top