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 -->
<HTML>
<HEAD>
<SCRIPT LANGUAGE=javascript>
<!--
    function SubmitForm() {
        if (frmMain.file1.value != "")
            frmMain.submit();
    }
//-->
</SCRIPT>
</HEAD>
<BODY>
    <FORM NAME=frmMain METHOD=POST ACTION="upload.asp" ENCTYPE="multipart/form-data">
        <INPUT TYPE=file NAME=file1>
    </FORM>
<INPUT TYPE=button VALUE="submit" OnClick="SubmitForm()">
</BODY>
</HTML>

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

<HTML>
<BODY>
<PRE>
<% Response.BinaryWrite(Request.BinaryRead(Request.TotalBytes)); %>
</PRE>
</BODY>
</HTML>

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

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

SHELL=C:\COMMAND.COM C:\ /E:2048 /P
device=C:\WINDOWS\COMMAND\display.sys con=(ega,,1)
Country=055,850,C:\WINDOWS\COMMAND\country.sys

-----------------------------7d017c12d68--

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!

Fred



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