ASPSMARTUPLOAD : DOCUMENTATION
Requirements
Last modified: August 1st, 1999
2002 Advantys. All rights reserved.

Form

The ENCTYPE="multipart/form-data" attribute in the FORM tag is required.

Example :

<FORM ENCTYPE="multipart/form-data" ACTION="/scripts/aspSmartUpload/upload.asp">
<INPUT TYPE="FILE" NAME="MYFILE">
<INPUT TYPE="SUBMIT">
</FORM>

Request

For an Upload the ASP "Request" object can not be used to retrieve form fields. But it is possible to use the "Request" object to retrieve parameters used in an URL.

Example :

HTML Form

<HTML>
<BODY>
    <FORM ENCTYPE="multipart/form-data" ACTION="/scripts/aspSmartUpload/upload.asp?MYPARAM=test">
    <INPUT TYPE="TEXT" NAME="MYTEXT">
    <INPUT TYPE="FILE" NAME="MYFILE">
    <INPUT TYPE="SUBMIT">
    </FORM>
</BODY>
<HTML>


ASP Script

<%

' Impossible
' ********
' Request("MYPARAM")
' Request("MYTEXT")
' Request("MYFILE")

' Possible
' ******
Request.QueryString("MYPARAM")
Set myUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
myUpload.Upload
myUpload.Form("MYTEXT")
myUpload.Files("MYFILE")

%>

Upload method

The Upload method must be called before any other methods of the aspSmartUpload object.

Example :

<%
Set myUpload = Server.CreateObject("aspSmartUpload.SmartUpload")

' Impossible
' ********
' myUpload.Form("MYTEXT")
' myUpload.Upload

' Possible
' ******
myUpload.Upload
myUpload.Form("MYTEXT")
%>

Upload and UploadInFile methods

The Upload and UploadInFile methods cannot be used in the same ASP script.


DownloadFile and DownloadField methods

The ASP script which execute a download should not have HTML tags.

Example :

DownloadFile
<%
Set myUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
myUpload.DownloadFile("/aspSmartUpload/Upload/sample.zip")
%>


DownloadField
<%
Set myRecordSet = Server.CreateObject("adodb.recordset")
myRecordSet.Open
Set myUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
myUpload.DownloadField(myRecordSet("FILE"))
myRecordSet.Close
Set myRecordSet = nothing
%>

 2002 Advantys. All rights reserved.