ASPSMARTUPLOAD : DOCUMENTATION
SmartUpload Object
Last modified: March 1st, 2002 
© 2002 Advantys. All rights reserved.

ContentDisposition

The ContentDisposition property contains the string of the Content Disposition Hearders for the MIME Type.

Syntax
.ContentDiposition

Values
- "attachment;"
- "inline;" for MSIE 5 users
- ""

Example

<%
MyUpLoad.ContentDisposition = "inline;"
%>

DownloadBlockSize

The DownloadBlockSize value is used to determine how much data will be read from the data source at one time. This property is used in following  methods : FieldToFile, DownloadFile and DownloadField.

Syntax
.DownloadBlockSize

Example

<%
MyUpLoad.DownloadBlockSize = 4096
- ou -
MyUpLoad.DownloadBlockSize = 32768
%>

TotalBytes

The TotalBytes property contains the Size in bytes of the POST form.

Syntax
.TotalBytes

Return Value
Returns a Long value.

Example

<%
Response.Write("Bytes=" & MyUpLoad.TotalBytes & "<br>")
%>

BinaryData

The BinaryData property returns the Byte corresponding to the table index containing the transmitted data.

Syntax
.BinaryData(lngIndex)

Return Value
Returns a byte value.

Parameter
lngIndex is an index of the byte's Array.

Example

<%
for i=0 to MyUpLoad.TotalBytes - 1
  response.write( Chr(MyUpload.BinaryData(i)) )
next i
%>

Upload

The Upload method.

Syntax
.Upload

Example

<%
Dim MyUpLoad
Set MyUpload = Server.CreateObject("AspSmartUpLoad.SmartUpLoad")
MyUpload.UpLoad
%>

Save

The Save method saves all files in the disk.

Syntax
.Save( [DestinationPath] )

Return value

Returns a Long value which indicates how many files have been saved.

Parameter

DestinationPath is optional. If this parameter is not specified then all files will be saved in the root directory of the web server.

Example

<%
Dim MyUpLoad
Dim lngNBFile
Set MyUpload = Server.CreateObject("AspSmartUpLoad.SmartUpLoad")
MyUpload.Upload
MyUpload.Save
Response.Write(lngNBFile & " files saved.")
%>

DownloadFile

The DownloadFile method.

Syntax
.DownloadFile(SourceFile[, ContentType, NewFileName])

Parameter

SourceFile is the source file. The path can be a virtual or a physical path. If there is only a file name, then this one have to be placed in the root directory of the web server.
ContentType.
NewFileName indicates a new name in the "Save As" dialog box.

Example

<%
Dim MyUpLoad
Set MyUpload = Server.CreateObject("AspSmartUpLoad.SmartUpLoad")
MyUpload.DownloadFile "c:\temp\myFile.txt", "application/x-zip-compressed", "NewFileName.txt"
%>

DownloadField

The DownloadField method.

Syntax
.DownloadField(SourceField[, ContentType, NewFileName])

Parameter

SourceField is the record of a DataBase.
ContentType.
NewFileName indicates a new name in the "Save As" dialog box.

Example

<%
Dim MyUpLoad
Set MyUpload = Server.CreateObject("AspSmartUpLoad.SmartUpLoad")
MyUpload.DownLoadFied "myRecordSet("FILE")", "application/x-zip-compressed", "NewFileName.txt"
%>

FieldToFile

The FieldToFile method writes file from a DataBase to a specified directory. This method creates a new file.

Syntax
.FieldToFile FieldName(DestinationFile)

Parameter
DestinationFile is the file destination.

Example

<%
myUpload.FieldToFile "c:\temp\myFile.txt"
%>

UploadInFile

The UploadInFile method creates a new file with all data of the POST form.

Syntax
.UploadInFile (DestinationFile)

Parameter
DestinationFile is the file destination.

Example

<%
myUpload.FieldToFile "c:\temp\myData.txt"
%>

© 2002 Advantys. All rights reserved.