JScript and Request.BinaryRead()... 
Author Message
 JScript and Request.BinaryRead()...

I have tried to "upload" a file using a form and reading the data stream from an asp page like this:

<!-- Client side: myUploadPage.htm -->
<SCRIPT LANGUAGE=javascript>
    function SubmitForm() {
        if (frmMain.file1.value != "")
    <FORM NAME=frmMain METHOD=POST ACTION="upload.asp" ENCTYPE="multipart/form-data">
        <INPUT TYPE=file NAME=file1>
<INPUT TYPE=button VALUE="submit" OnClick="SubmitForm()">

<!-- Server side: upload.asp -->

<% Response.BinaryWrite(Request.BinaryRead(Request.TotalBytes)); %>

So... if I upload my config.sys file (f.i), I can get:

Content-Disposition: form-data; name="file1"; filename="C:\Config.sys"
Content-Type: text/plain

device=C:\WINDOWS\COMMAND\display.sys con=(ega,,1)


Everything ok 'til now... by I cannot manipulate the object returned by Request.BinaryRead() as a string in JScript! (there are some functions in VBScript like LenB, MidB, InstrB, etc... to manipulate Binary Data...)

I've tried to type cast the object returned by Request.BinaryRead without success...

Please, help!


Sat, 17 May 2003 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Request.BinaryRead and ASP (VBScript)

2. Request.BinaryRead & ASP (VBScript)

3. Request.BinaryRead()

4. How can I access the data in a variant ( Request.BinaryRead( n ) )

5. VB request.binaryread ?

6. What does Request.BinaryRead return?

7. Request.BinaryRead()

8. Server Side JScript - Requesting info from a form

9. Request.ServerVariables("...") with JScript

10. Request.QueryString in Jscript?

11. jscript and asp request object

12. Retrieve the requested path through JScript in ASP


Powered by phpBB® Forum Software