Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP receive binary stream and save to file

Status
Not open for further replies.

elbretto

IS-IT--Management
Jul 30, 2002
2
US
Help!
I am trying to get an ASP page to receive a binary stream I am sending it using WinInet (HTTPSendRequestEx).

Using the following in ASP, I can tell how many bytes were sent, but am unable to 'see' the actual data. I am needing to 'catch' this data and save it to a file.
Does anyone have any ideas? Is this enough info?
thanks!

PostSize = Request.TotalBytes

'Read POST data in 1K chunks
BytesRead = 0
For i = 1 to (PostSize/1024)
ReadSize=1024
PostData = Request.BinaryRead(ReadSize)
BytesRead = BytesRead + ReadSize
ts.writeline request.binaryread
Next

'Read remaining fraction of 1K
ReadSize=TotalBytes - BytesRead
If ReadSize <> 0 Then
PostData = Request.BinaryRead(ReadSize)
BytesRead = BytesRead + ReadSize
End If

' Send results back to client
Response.Write BytesRead
Response.Write &quot; bytes were read.&quot;
 
I tried to used wininet to post data to a asp pages. and write the data the hard drives. it was okay if the contents was string. However, there was some problem if the contetns was an image file.. any idea?? the code works fine when it was window2k with regional setting and default language set to western english.

However, when i tried to deploy the same thing to win2k which default language change to simplified Chinese.......................................

do you have any idea.. please let me know. thanks..

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top