开发者

How to get the Binary data of an input="file" server-side

What would change in this code? It'sonly returning one line of data, theres got to be more than that for the file i selected, and if an image, how w开发者_开发知识库ould i get the width/height of the image using this procedure?

 <%
 a=Request.TotalBytes
 b=Request.BinaryRead(a)
 Response.BinaryWrite(b)
 %>

 <form method="post" enctype="multipart/form-data">
 <input type="file" />
 <input type="submit" />
 </form>


Handling a binary upload in classic ASP is a little more complicated that just those three lines. There is a project with source code available to handle binary uploads from classic ASP. Maybe a look at that code will get you on your way. Otherwise, maybe the script itself is a solution for you:

http://www.freeaspupload.net/

http://www.freeaspupload.net/freeaspupload/viewsource.asp

Hope this helps,

Erik


I have written a script in the past that handles file upload plus identifying image dimensions - feel free to use it as long as you keep all the copyright lines in place. (Parts are not my own writing)

If you have more specific question or problem, feel free to ask.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜