Web Hosting Houston

Web Site Hosting and web design

WEB SITE HOSTING

WEB SITE DESIGN

INTERNET MARKETING

DOMAIN REGISTRATION

SUPPORT

CONTACT US

 
   Sunday, May 18, 2008 Call 713.269.6413 Today!
 
 
 
  Support
ASP MAIL - Sample and Documentation
A Simple Upload Form
The following HTML form (located in the sample file Form1.asp) enables a user to select up to three files for uploading to the server:

<HTML>
<BODY BGCOLOR="#FFFFFF">
   <FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="UploadScript1.asp">
      <INPUT TYPE="FILE" SIZE="40" NAME="FILE1"><BR>
      <INPUT TYPE="FILE" SIZE="40" NAME="FILE2"><BR>
      <INPUT TYPE="FILE" SIZE="40" NAME="FILE3"><BR>
   <INPUT TYPE=SUBMIT VALUE="Upload!">
   </FORM>
</BODY>
</HTML>

Notice the ENCTYPE="multipart/form-data" attribute in the <FORM> tag. It instructs the browser to send the entire file to the server and not just the file name entered in the input text box. It is absolutely mandatory that your upload forms contain this attribute, or no uploading can be performed.

This form contains three items <INPUT TYPE="FILE"> which appear on the page as text boxes with the Browse button next to them. Each box can be used to select one file only. While the SIZE attribute of an <INPUT TYPE="FILE"> item is optional, the NAME attribute is required.

This form invokes the upload script UploadScript1.asp shown below:

<HTML>
<BODY>
<%
Set Upload = Server.CreateObject("Persits.Upload")
Count = Upload.Save(server.map("upload"))

Response.Write Count & " file(s) uploaded to upload"
%>
</BODY>
</HTML>

The first line of the ASP script simply creates an instance of the AspUpload object. The second line calls the Save method of the component which actually performs the upload: it parses the information POSTed by the browser, figures out how many files are being uploaded, and saves them in a specified local directory on the server under their original names.

The Save method returns the number of files successfully uploaded. In case of an error this method will throw an exception.



24 x 7 Support
High-performance / high-reliability
Free DNS entries
Pop and SMTP Servers
Web Based Email
Graphical Website Statistics
Nightly Backups
FTP Access
Domain Registration for $15.00

For more information please check out our Web Packages.


Sign Up for our Monthly
Newsletter / Specials:


Your website not coming up on the first page?
Try Meta-Critic today and find out why no one can find you in the search engines!

To test your website enter your website address:
  

Search for your Domain name:
  www.






 


web hosting | web design | web marketing | domain registration | support | contact

Copyright© 1999 - 2008 NewTechLabs
All Rights Reserved.
Houston, Texas

Site Designed by
Houston web design and hosting company