Uploading File Using ASPUpload

You can upload a file by creating a html file and an asp file utilizing ASPUpload component from Persist Software. 2 files is needed for following sample: upload.html and upload.asp.

upload.html sample coding - used as a form for user to browse and select for the file to be uploaded from user's local.

Line No Coding
1 <html>
2 <head>
3 <title>Upload file</title>
4 </head>
5 <body>
6 <form method="POST" action="test.asp" ENCTYPE="multipart/form-data" >
7 <p><input type="file" name="filename" size="25">
8 <input type="submit" value="Upload!" name="UploadFile"></p>
9 </form>
10 </body></html>

Line No Explanation
1 Open html tag
2 Open Head tag
3 Specify the title of the website
4 Close head tag
5 Open body tag
6 Create a form for the upload file. When a use press on the button the website will call the test.asp file to execute the server side script
7 This input type is to create a file upload component for the user to browse the file that they would like to upload to their web space.
8 Create the button for this website. After the user has finish browsing the file, they can upload
9 the file by click on this button. This component will call the test.asp file.
10 Close body and html tag

Sample Coding:

upload.asp sample coding - process the upload request submitted from upload.html.
Line No Coding
1 <%
2 Set Upload = Server.CreateObject("Persits.Upload")
3 Upload.Save(server.MapPath("FileUpload\"))
4 %>

Line No Explanation
1 Open ASP tag
2 Create the Persist.upload object
3 Upload the file to your desired path. The above path is uploaded to your C:\Domain\domain_name\wwwroot\FileUpload\filename
4 Close ASP tag

Sample Coding:

For complete manual regarding Persits Software's ASPUpload, please refer http://aspupload.com/manual.html

Add Feedback