How to use Dundas Upload?

Dundas upload control is a flexible and reliable component allows you to accept, save, and manipulate the files uploaded with a web browser. Dundas upload is designed to work with Active Server Pages (ASP).

Dundas' email component and upload component are no longer supported by the Dundas. Dundas software has provided AspAlliance.com with two free components for users. AspAlliance.com is now the exclusive distributor of these two components. In this tutorial, we will demonstrate the implementation of Dundas Upload.

In the below sample HTML form, ENCTYPE="multipart/form-data attribute will instruct the browsers to send the entire file to the server. Your form must have this attribute otherwise no uploading can be performed.

The form contains three <INPUT TYPE="FILE"> which will appear as upload functionality with Browse button next to them. Each box can be used to select one file only.

The SIZE attribute of <INPUT TYPE="FILE">is optional, whereas the NAME attribute is mandatory. This form will invoke the upload script at upload.asp page as shown below.


HTML Code

<HTML>
<BODY>
<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="upload.asp">
<input type="FILE" size="40" name="FILE1"><br>
<input type="FILE" size="40" name="FILE2"><br>
<input type="FILE" size="40" name="FILE3"><br>
<INPUT TYPE="SUBMIT" VALUE="Uploaded" NAME="btnsubmit">
</FORM>
</BODY>
</HTML>

The 5th line of the following ASP script will simply create an instance of the Upload object. The 6th line will disable unique names to preserve the original filename and 7th line will call the Save method of the component which will perform the upload. It will parse the information posted via web browser, determine the number of files are being uploaded, and save them in a specified server directory under their original names.

ASP Code

<HTML>
<BODY>
<%
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
Set uploadObj = Server.CreateObject("Dundas.Upload.2")
uploadObj.UseUniqueNames = False
uploadObj.Save(Server.MapPath(".\imagefolder"))
response.write "File Uploaded"
else
response.write "No file is selected"
end if
%>
</BODY>
</HTML>

  • 360 Users Found This Useful

Was this answer helpful?

Related Articles

How to send Emails via ASP using SMTP authentication?

This topic includes the sample code to send email from ASP.Net using C# code :Sample Code :<%@...

MySQL ODBC driver on Windows 2008 / 2012 server

We have installed MySQL 5.1 ODBC driver on Windows 2008 / 2012 shared hosting server.

Sample script for CDO email

CDO (Collaboration Data Objects) is an inbuilt ASP component used to send emails via ASP. It is...

How to use Dundas Chart?

How to create a Basic Pie Chart with Dundas Chart To use this control in a web site, you will...

How to use Dundas Mailer?

A. Sending an Email with the QuickSend Method <% Dim objMailer 'Mailer control Set...