Search:     Advanced search
Browse by category:
Glossary | Ask question



Using aspSmartUpload to upload files using ASP
Add comment
Views: 95
Votes: 0
Comments: 0

You can use the following code to upload files on our Windows 2000/2003 servers.

The html form allows the user to select the file(s).

Example HTML File (Form.html)

<HTML>
<BODY BGCOLOR="white">

<H1>aspSmartUpload : Sample 1</H1>
<HR>

<FORM METHOD="POST" ACTION="Sample1.asp " ENCTYPE="multipart/form-data">
<INPUT TYPE="FILE" NAME="FILE1" SIZE="50"><BR>
<INPUT TYPE="FILE" NAME="FILE2" SIZE="50"><BR>
<INPUT TYPE="FILE" NAME="FILE3" SIZE="50"><BR>
<INPUT TYPE="FILE" NAME="FILE4" SIZE="50"><BR>
<INPUT TYPE="SUBMIT" VALUE="Upload">
</FORM>

</BODY>
</HTML>

The ASP file uses aspSmartUpload to save the files to the server’s disk.

Example ASP File (Sample1.asp ) - saves files to a folder named "Upload" in your "www" folder which you should create

<HTML>
<BODY BGCOLOR="white">

<H1>aspSmartUpload : Sample 1</H1>
<HR>

<%
' Variables
' *********
Dim mySmartUpload
Dim intCount

' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")

' Upload
' ******
mySmartUpload.Upload

' Save the files with their original names in a virtual path of the web server
' ****************************************************************************
intCount = mySmartUpload.Save("/Upload")

' Display the number of files uploaded
' ************************************
Response.Write(intCount & " file(s) uploaded.")
%>
</BODY>
</HTML>

 

In this sample, the files are saved directly with their original name to a virtual directory on the web server.



Other questions in this category
What is a DSN?
500 Error Message
Using ASPEMAIL to send mails using ASP
Where can I find more information about Python?
ASPEMAIL is not working
How do I stop browsers & proxy servers from caching my web pages?
ASP.NET Test Page
Active Server Pages error ASP 0131 or Server.MapPath() error 'ASP 0175 : 80004005'