Knowledgebase: ASP programming
How to use Dundas Upload?
Posted by Admin Ad on 15 July 2005 08:51 AM
The following code demonstrates how to populate the Upload control's collections, save uploaded files to disk and retrieve form data. Please note that for brevity we do not perform any error checking
 
We will assume that a form with an encoding type of "Multipart/Form-Data" is POSTING to the ASP page which contains the following code:
 
1 . <%
2 . Dim objUpload
3 . Set objUpload = Server.CreateObject("Dundas.Upload.2")
4 . objUpload.Save "c:temp"
5 . strName = objUpload.Form("txtName")
6 . strSize = objUpload.Files(0).Size
7 . Set objUpload = Nothing
8 . %>
 
Explanation According to Line
1 . Open ASP tag
2 . Declare a variable named objUpload
3 . Create instance of Upload control
4 . Save uploaded files to to disk specified by physical path
5 . Retrieve the value of a form element called txtName
6 . Retrieve the size of the first uploaded file
7 . R
elease resources
8 . Close ASP tag
 
(355 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).