我只是照搬过来的,我也是刚找到。我自己还没看明白源码呢。:)<br>
你只有自己修改了。我把整个网页一起贴过来吧。谁英文好翻译一下。<br>
一页贴不下,分两页。<br>
upload form<br>
usually, you use an html form to submit data from the browser to the web server. that form can contain text fields, checkbox, button and also a file type control to upload files. the user fills in the form with his data and submits the form to the server.<br>
<br>
the enctype attribute of the <form> element specifies the content type used to encode the form data set for submission to the server. the enctype attribute used by default is " application/x-www-form-urlencoded ". however, that enctype is inefficient for sending large quantities of text, text containing non-ascii characters or binary data to the server. the content type " multipart/form-data " should be used to submit forms in case of file uploading. actually, it can be used to submit files and binary data. <br>
<br>
a " multipart/form-data " message contains a series of parts, where each part is expected to contain: <br>
<br>
a content-disposition header whose value is " form-data " <br>
a name attribute specifying the control name. <br>
for a file type control, the part contains some more information:<br>
<br>
a filename attribute specifying the original path and file name on the client <br>
a content-type header of the binary data control sent. <br>
those headers are followed by the binary or text content of the control.<br>
<br>
the following example illustrates " multipart/form-data " encoding. the client would have this form in the browser: <br>
<br>
<form method="post" enctype="multipart/form-data" action="upload.asp"><br>
<input type="text" name="email" value="phcollignon@email.com"><br><br>
<input type="file" name="blob"><br><br>
<input type="submit" name="enter"><br>
</form><br>
<br>
<br>
<br>
if this form is submitted, the following request can be read on the server:<br>
<br>
—————————–7cf87224d2020a <br>
content-disposition: form-data; name="email" <br>
<br>
phcollignon@email.com<br>
—————————–7cf87224d2020a<br>
content-disposition: form-data; name="blob"; filename="c:\image.gif"<br>
content-type: image/pjpeg <br>
<br>
ÿøÿàjfifhhÿûc…<br>
…ÿù <br>
—————————–7cf87224d2020a <br>
content-disposition: form-data; name="enter" <br>
<br>
submit query <br>
—————————–7cf87224d2020a– <br>
<br>
that content can be displayed if it is sent back as a response to the client. the binary data should be read and written with request.binaryread and response.binarywrite methods.<br>
<br>
<%<br>
response.binarywrite(request.binaryread(request.totalbytes))<br>
%><br>
<br>
you can see that parts of the response are delimited by boundaries:<br>
<br>
—————————–7cf87224d2020a<br>
<br>
and the last boundary is followed by: — <br>
<br>
<br>
there is one content-disposition for each control. the name attribute identifies the control sent by the html form (email, blob and enter). for a file type control (blob), the file name is also part of content-disposition header and, a content-type header gives the content type of the binary data. <br>
<br>
《无组件上传文件》
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 《无组件上传文件》
相关推荐
-      ASP 简介
-      SQL注入天书 – ASP注入漏洞全接触
-      用.net 处理xmlHttp发送异步请求
-      asp.net创建文件夹的IO类的问题
-      如何实现ASP.NET网站个性化
-      关于ASP.NET调用JavaScript的实现
-      ASP利用Google实现在线翻译功能
-      Asp无组件生成缩略图
