ASPired2Upload is an ASP upload class that enables you to easily upload files to your web site. In order to use ASPired2Upload, you only need to set up your server and add a few lines of code to your form.

ASP2Count

Server Set Up

  1. Upload the file "ASPired2Upload.asp to your server.
  2. Set the write permission for a folder that you want to upload files to.

File Set Up

There are several bits of code needed for your form. First, you need to add the include file.

<!-- #INCLUDE FILE="ASPired2Upload.asp" -->

You may need to change the path to the include file based on your file hieracrhy. In your form, set the encode type for the form.

<form action="index.asp?MODE=Upload" method="post" enctype="multipart/form-data">

In the file that your form calls, insert the following code.

<%
    dim Upload, strResponse, key_count, fKey
Dim str_dir

str_dir = Server.Mappath("uploadedFiles\")
if Request("MODE") = "Upload" Then
set Upload = new c_ASP2Upload
Upload.StartUpload(str_dir)
strResponse = ""
key_count = Upload.UFiles.keys
if (UBound(key_count) <> -1) then
strResponse = "<B>Files uploaded:</B> "
for each fKey in Upload.UFiles.keys
strResponse = strResponse & Upload.UFiles(fKey).FileName"
next
end if
end If
%>

Change the upload path after Mappath to match the path on your server. In this example, the variable strResponse contains the file upload log.