How to use Dundas Upload? Print

  • 769



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 = color=rosybrown>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 . color=black>Declare a variable named objUpload

3 . Create
instance ofUpload 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

color=#000000>


Was this answer helpful?

« Back