ASPSMARTUPLOAD : DOCUMENTATION |
SmartUpload Object Last modified: March 1st, 2003 © 2003 Advantys. All rights reserved. |
The CodePage property sets the code page to save files with correct filename. You must use it if you want save files with unicode file names. list of code page.
Syntax
.CodePage
Registry
Key : HKEY_LOCAL_MACHINE\SOFTWARE\Advantys\aspSmartUpload
Value : CodePageExample
<%
MyUpLoad.CodePage = "big5"
%>
The TotalMaxFileSize property contains the maximum allowed size of all files to be uploaded. If this property is null then there is no limit for the total file's size uploaded. By default this property is null. If there is a key in the Registry corresponding to this property, then it keeps the string value of this key.
Syntax
.TotalMaxFileSize
Registry
Key : HKEY_LOCAL_MACHINE\SOFTWARE\Advantys\aspSmartUpload
Value : TotalMaxFileSizeReturn Value
Returns a Long value.Example
<%
MyUpLoad.TotalMaxFileSize = 100000
Response.Write("TotalMaxFileSize=" & MyUpLoad.TotalMaxFileSize & "<br>")
%>
The MaxFileSize property contains the maximum allowed size of one file to be uploaded. If this property is null then there is no limit for the file's size uploaded. By default this property is null. If there is a key in the Registry corresponding to this property, then it keeps the string value of this key.
Syntax
.MaxFileSize
Registry
Key : HKEY_LOCAL_MACHINE\SOFTWARE\Advantys\aspSmartUpload
Value : MaxFileSizeReturn Value
Returns a Long value.Example
<%
MyUpLoad.MaxFileSize = 100000
Response.Write("MaxFileSize=" & MyUpLoad.MaxFileSize & "<br>")
%>
The AllowedFilesList property contains the list of file's extensions which are allowed to be uploaded. If this list is empty then all files are allowed. If the list is not empty then only the files with a specified extension are allowed. In order to allow the files without extension list must contain two commas ",,". By default this property is empty. If there is a key in the Registry corresponding to this property, then it keeps the string value of this key.
Syntax
.AllowedFilesList
Registry
Key : HKEY_LOCAL_MACHINE\SOFTWARE\Advantys\aspSmartUpload
Value : AllowedFilesListReturn Value
Returns a String value.Example
<%
MyUpLoad.AllowedFilesList = "txt,doc,xls"
Response.Write("Files allowed=" & MyUpLoad.AllowedFilesList & "<br>")
%>
The DeniedFilesList property contains the list of file's extensions which are denied to be uploaded. If this list is empty then no files are denied. All the files with an extension in the DeniedFileslist are denied even if they are in the AllowedFilesList. In order to deny the files without an extension the list must contain two commas ",,". By default this property is empty. If there is a key in the Registry corresponding to this property, then it keeps the string value of this key.
Syntax
.DeniedFilesList
Registry
Key : HKEY_LOCAL_MACHINE\SOFTWARE\Advantys\aspSmartUpload
Value : DeniedFilesListReturn Value
Returns a String value.Example
<%
MyUpLoad.DeniedFilesList = "bat,exe,com,asp"
Response.Write("Files denied=" & MyUpLoad.DeniedFilesList & "<br>")
%>
The DenyPhysicalPath property prevents to access a path other that a virtual path of the Web Server. By default this property is false. If there is a key in the Registry corresponding to this property, then it keeps the string value of this key.
Syntax
.DenyPhysicalPath
Registry
Key : HKEY_LOCAL_MACHINE\SOFTWARE\Advantys\aspSmartUpload
Value : DenyPhysicalPathReturn Value
Returns a Boolean value.Example
<%
MyUpLoad.DenyPhysicalPath = True
Response.Write("Physical Path=" & MyUpLoad.DenyPhysicalPath & "<br>")
%>
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"
%>
© 2003 Advantys. All rights reserved.