"No component Upload file"

Source: Internet
Author: User
Tags header html form client
Upload | No components I just copied it, and I just found it. I have not yet read the source code. :) <br>
You only have to revise it yourself. I'll post the whole page together. Who is good at translating English. <br>
One page does not fit, two pages. <br>
Upload form<br>
Usually, use a HTML FORM to submit data from the browser to the Web server. This form can contain text fields, CheckBox, button and also a file type control to upload files. The user fills in the "form" and the "submits" form to the server.<br>
<br>
The enctype <FORM> element specifies the content type used to encode the FORM data set for Submissi On to the server. The enctype attribute used by default is "application/x-www-form-urlencoded". However, that enctype are 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 is 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 you are 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
<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 being 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's content can be displayed if it's sent back as a response to the client. The binary data should is read and written with Request.BinaryRead and Response.BinaryWrite methods.<br>
<br>
<%<br>
Response.BinaryWrite (Request.BinaryRead (request.totalbytes)) <br>
%><br>
<br>
You can be parts the response are delimited by boundaries:<br>
<br>
-----------------------------7cf87224d2020a<br>
<br>
And the last boundary are followed by: '-' <br>
<br>
<br>
There is one content-disposition for the 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>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.