Linux Hosting
NT/2000 Hosting
DYO Internet Access
HTMLez.com
JAVASCRIPTez.com
PHPez.com

Select a Domain
    

The iFUN.com web hosting company along with many other hosting companies provides the SoftArtisan FileUpload component. This would be used to permit viewers to upload files to specific directories on your web site.

You must first have iFUN.com (or your other hosting company) set security for the directory that will receive these uploaded files. Request that this directory grant full permissions for the IIS anonymous user.

Your client side html must enclude a form similar to that below:

<form name=theform action="Upload.asp" method="post"
         enctype="multipart/form-data">
<!-- the enctype="multipart/form-data" is necessary -->
<input type="file" name="file1" size="50">
<input type="file" name="file2" size="50">
...  <!-- as many as you want and is reasonable -->
</form>
The Upload.asp file would contain code similar to the following:
Dim safileup
Set safileup = Server.CreateObject("SoftArtisans.FileUp")

safileup.Form("file1").Path = thePath 
     'where thePath has been defined, 
         'perhaps d:\inetpub\iadventist\uploadDirectory\
safileup.Form("file1").Save
Response.write "1st file uploaded: " 
                & safileup.Form("file1").TotalBytes
Response.write " bytes<br>"

safileup.Form("file2").Path = thePath
safileup.Form("file2").Save
Response.write "2nd file uploaded: " 
                & safileup.Form("file2").TotalBytes
Response.write " bytes<br>"
You could optionally check the content-type of the file and permit upload on only the file types you choose to permit.
r = safileup.Form("file1").ContentType
if r = "image/gif" then
        safileup.Form("file1").Path = thePath
        safileup.Form("file1").Save
        Response.write "1st file uploaded: " 
        Response.write safileup.Form("file1").TotalBytes
        Response.write " bytes<br>"
end if
Other file types (mime types) might be
  • image/gif
  • image/jpg
  • image/png
  • text/html
Begin using this SoftArtisans File Upload component to enable your viewers to contribute to your web site.

If you have an asp article or tip you would like to contribute to ASPez.com, please email it to the webmaster.

cover
Average Customer Review:
February 2002
http://www.wrox.com

cover
Average Customer Review:
February 2002
http://www.wrox.com