Previously collected some information---how to build their own upload components of the programming ideas

Source: Internet
Author: User
In the article I posted last time, I mentioned several comparisons of upload components.
Now we have our own hands and clothing to build our own upload component
This upload component should have the following features:
1. Should be able to accept the values passed through the form elements of various HTML, without
Passed through the text or select.
2. Should be able to give an upload path
3. should be able to limit the size of uploaded files
4. should be able to support multiple files upload simultaneously
5. should be able to handle exception errors
6. Should be able to work stably
7. Should be able to do it without favoritism (that is, being able to work simultaneously in IE and Netscape)
8. Ability to save files in a database
9. Should be able to restrict user permissions
The code and file are shown below (the old rules, I don't explain them in detail)
1. Upload.htm
<HTML>
<HEAD><TITLE>Upload</TITLE></HEAD>
<BODY>
<form name= "Frmupload" method= "Post" enctype= "Multipart/form-data" action= "upload.asp" > <TABLE>
<TR><TD> author </td><td><input type= "text" name= "Txtauthor" ></TD></TR>
<TR><TD> file </td><td><input type= "file" Name= "Txtfilename" ></TD></TR>
&LT;TR&GT;&LT;TD colspan= "2" align= "right" ><input type= "Submit" value= "Upload" ></TD></TR>
</TABLE>
</FORM>
</BODY>
</HTML>
* * Note: use enctype= "Multipart/form-data" to allow form to submit a file
2. Upload.asp
<%@ Language=vbscript%>
<%
Option Explicit
Response.Buffer = True
On Error Resume Next
If Request.ServerVariables ("request_method") = "POST" Then
Dim Objupload
Dim lngmaxfilebytes
Dim Struploadpath
Dim Varresult
Lngmaxfilebytes = 10000
Struploadpath = "C:inetpubwwwrootupload"
Set objupload = Server.CreateObject ("Pjuploadfile.clsupload")

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.