ASP component upload---------One

Source: Internet
Author: User
ASP component File Object
Currently, applications based on browser/server mode are more popular. When a user needs to transfer files to a server, one of the common methods is to run the FTP server and set the FTP default directory for each user to the user's Web home directory, so that the user can run the FTP client and upload files to the specified Web directory. This requires users to know how to use an FTP client. Therefore, this solution is only feasible for experienced users who are familiar with FTP.
If we can integrate the file upload function with the web, so that users can complete the upload task with only a Web browser, this will be very convenient for them. However, since the file System object can only transfer text file limitations, the biggest problem with ASP is the problem of uploading files. Here's how to upload a file in a Web page based on an HTTP protocol.
A Three mechanisms for uploading over HTTP
There are three mechanisms for uploading via http: RFC1867, put, and WebDAV.
Put was introduced in HTTP 1.1 with a new HTTP verb. When the Web server receives an HTTP put and object name, it authenticates the user, receives the contents of the HTTP stream, and stores it directly into the Web server. Because this can cause damage to a Web site, it can also lose the most HTTP advantage: Server programmability. In the case of put, the server handles the request itself: there is no room for CGI or ASP applications to intervene. The only way to get your application to capture put is to operate at the lower level, the ISAPI filter layer. The application of put is limited due to the corresponding reasons.
WebDAV allows distributed authentication and translation of Web content. It introduces several new HTTP verbs that allow uploading via HTTP, locking/unlocking, registering/verifying Web content. The "Save to Web" in Office 2000 is implemented through WebDAV. If all you're interested in is uploading content, WebDAV is a great application and it solves a lot of problems.
However, if you need to upload files in your Web application, WebDAV is useless to you. Like the HTTP put, those WebDAV verbs are interpreted by the server, not the Web application. You need to work on these verbs in the ISAPI filtering layer to access WebDAV and interpret the content in your application.
RFC1867 (Http://www.ietf.org/rfc/rfc1867.txt) was eventually accepted by the HTML3.2 as a recommended standard. It's a very simple but powerful idea: Define a new type in a form field.
<input type= "FILE" >
And in the form itself, a different encoding scheme is added, no longer using the typical:
<form action= "formproc.asp" method= "POST" >

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.