ASPSMARTUPLOAD : DOCUMENTATION |
SmartUpload
Object Last modified: March 1st, 2002 © 2002 Advantys. All rights reserved. |
The ContentDisposition property contains the string of the Content Disposition Hearders for the MIME Type.
Syntax
.ContentDipositionValues
- "attachment;"
- "inline;" for MSIE 5 users
- ""Example
<%
MyUpLoad.ContentDisposition = "inline;"
%>
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
.DownloadBlockSizeExample
<%
MyUpLoad.DownloadBlockSize = 4096
- ou -
MyUpLoad.DownloadBlockSize = 32768
%>
The TotalBytes property contains the Size in bytes of the POST form.
Syntax
.TotalBytesReturn Value
Returns a Long value.Example
<%
Response.Write("Bytes=" & MyUpLoad.TotalBytes & "<br>")
%>
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
%>
The Upload method.
Syntax
.UploadExample
<%
Dim MyUpLoad
Set MyUpload = Server.CreateObject("AspSmartUpLoad.SmartUpLoad")
MyUpload.UpLoad
%>
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.")
%>
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"
%>
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"
%>
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"
%>
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.