Enterprise
Edition

 

Object Model FileUpEE Object
FileCollection Object FileEE Object Progress Object

The FileUpEe Object

The FileUpEe object is a file-transfer control, that processes both form-based file uploads and server-to-server SOAP transfers, enabling uploads from browser to Web-server to file-server.

To create an instance of FileUpEe in an ASP page, use:

[VBScript]
Set objFileUpEe = Server.CreateObject("SoftArtisans.FileUpEe")

The FileUpEE objects for ASP.NET are in the SoftArtisans.Net namespace. The objects can be referenced as fully qualified names, such as SoftArtisans.Net.FileUpEe. To minimize typing and errors, use an Import directive to import the namespace to the ASP.NET page. This allows you to reference objects by name alone, without the namespace prefix. Following the Page directive in the aspx page, include:

<%@Import namespace="SoftArtisans.Net"%>

To create an instance of FileUpEe in an ASP.NET page, use:

In C#:	FileUpEe oFileUpEe = new FileUpEe();
In VB.NET:	Dim oFileUpEe As New FileUpEe()
See Also
Form-based File Upload in HTML and SOAP Messages with Attachments.

FileUpEe Properties FileUpEe Methods  
AuditLogDatabase ErrorLogFile ReceiveTimeout Add
AuditLogDestination Files RequestTimeout AddDbDownloadFile
AuditLogFile FilterOn ResolveTimeout AddDownloadFile
ConnectTimeout FileUpCompat Resumable AddFile
ContentDisposition Form ResumeConnectionString   CreateDatabase
ContentType HostPort SaveMethod Dispose
CopyFiles HttpResponse SendTimeout NextProgressId
DbConnection Item StatusUrl ProcessRequest
DbPrimaryKey JobId StreamRequest ResetAllProgressIds
DbPrimaryKeyValue MaxKBytes TargetUrl ResetProgressId
DbSqlCommand MaxKBytesToCancel TempStorageLocation Resume
DbTableName OverwriteFiles TransferEncoding ReturnStatus
Description Page TransferStage SendRequest
DestinationDirectory PerConnectionBandwidthLimit   UseChecksum SendResponse
DynamicAdjustScriptTimeout   PerServerBandwidthLimit UseMemory TransferFile
Error ProgressId ValidateChecksums
ErrorLogDatabase ProgressIndicator
ErrorLogDestination PreserveMacBinary

FileUpEe Properties
AuditLogDatabase
Syntax
objFileUpEE.AuditLogDatabase(SATransferStage) [= Database Connection String]
Description

AuditLogDatabase sets the connection string for FileUpEE's audit log database. FileUpEE will save audit logs in a database if AuditLogDestination is set to saLogDatabase.

AuditLogDatabase is a Read/Write property.

You can use the database FileUpEEWs.mdb for audit logging on the web server, and FileUpEEFs.mdb for audit logging on the file server. Both databases are in doc-samples\Samples\UploadSamples\Intermediate\Resume\ASP). You can generate a new audit log database with FileUpEE.CreateDatabase. To see the audit log, open the table FileUpEE. The State column contains an SAUploadState value.

SAUploadState Values
saTransferComplete0
saTransferConnecting1
saTransferTransferring2
saTransferSuspended3
saTransferError4
saTransferCancelled5
saTransferIncomplete6
saTransferNotStarted7

The sample databases included with FileUpEE and the databases generated by FileUpEE.CreateDatabase are Access databases. To generate a set of tables for an Oracle or SQL Server database, run the script FileUpEE.sql. The script is included in the folder SoftArtisans\FileUpEE.

Parameter

AuditLogDatabase takes the parameter SATransferStage which specifies the stage of the upload: client to web server or web server to file server.

SATransferStage Values
saWebServer1
saFileServer2
Note

When audit logging is on, FileUpEE will create an audit log record for each file transfer. On a busy system, this can make the audit log database very large. If you enable logging, remember to delete old items in the audit log database.

See Also
Example
oFileUpEE.AuditLogDestination(saWebServer) = saLogDatabase
oFileUpEE.AuditLogDatabase(saWebServer) = "Provider=Microsoft.Jet.OLEDB.4.0;"&_
	"Data Source=C:\FileUpEE\FileUpEEWS.mdb;" & _
	"Persist Security Info=False"
Top
AuditLogDestination
Syntax
objFileUpEE.AuditLogDestination(SATransferStage) [= Audit Log Type as SALogDestination]
Description

AuditLogDestination sets the type of audit logging that FileUpEE will use. By default, FileUpEE will not create an audit log. To enable audit logging, set AuditLogDestination to an SALogDestination. When audit logging is enabled, FileUpEE will create an audit log for each file transfer. FileUpEE will record:

  • When the request from the previous stage (client, web server, or file server) began.
  • When the request from the previous stage completed.
  • When the upload to the next stage began.
  • When the upload to the next stage completed.
  • When the response from the next stage was received.
  • When the response to the previous stage began.
  • When the response to the previous stage completed.

AuditLogDestination is a Read/Write property.

Set AuditLogDestination to an SALogDestination:

SALogDestination Values
saNoLog0 (Default value)FileUpEE will not create an Audit log.
saLogFile1The audit log will be a file set by the property AuditLogFile.
saLogDatabase2FileUpEE will save log records in a database set by the property AuditLogDatabase.
saEventLog4File transfers will be logged in the Windows EventLog. To view the log go to Start/Control Panel/Administrative Tools/Event Viewer.
saDebugString8File transfers will be logged in the system debugger. You can view the records with tools such as Sysinternals DebugView .

If AuditLogDestination is set to saLogFile, set AuditLogFile. If AuditLogDestination is set to saLogDatabase, set AuditLogDatabase.

Parameter

AuditLogDestination takes the parameter SATransferStage which specifies the stage of the upload: client to web server or web server to file server.

SATransferStage Values
saWebServer1
saFileServer2
Note

When audit logging is on, FileUpEE will create an audit log for each file transfer. On a busy system, this can make the destination very large. If you enable logging, remember to delete old items in the log destination. This is particularly important when logging to a database or to Windows EventLog.

See Also
Example
oFileUpEE.AuditLogDestination(saWebServer) = saLogFile
oFileUpEE.AuditLogFile(saWebServer) = "D:\FileUpEE\auditlog.txt"
Top
AuditLogFile
Syntax
objFileUpEE.AuditLogFile(SATransferStage) [= Audit Log Path as String]
Description

AuditLogFile sets the path and file name of FileUpEE's audit log file. When audit logging is enabled, FileUpEE will create an audit log for each file transfer. FileUpEE will save the audit log to a file if AuditLogDestination is set to saLogFile.

AuditLogFile is a Read/Write property.

Parameter

AuditLogFile takes the parameter SATransferStage which specifies the stage of the upload: client to web server or web server to file server.

SATransferStage Values
saWebServer1
saFileServer2
See Also
Example
oFileUpEE.AuditLogDestination(saWebServer) = saLogFile
oFileUpEE.AuditLogFile(saWebServer) = "D:\FileUpEE\auditlog.txt"
Top
ConnectTimeout
Syntax
objFileUpEE.ConnectTimeout [= Timeout in Seconds as Long]
Description

ConnectTimeout sets a time-out value, in seconds, for server connection requests. If a connection request takes longer than this value, the request will be cancelled. The default value of ConnectTimeout is 40 seconds.

ConnectTimeout is a Read/Write property.

Example
objFileUpEE.ConnectTimeout = 60
Top
ContentDisposition
Syntax
objFileUpEE.ContentDisposition [= MIME Content-Disposition as String]
Description

ContentDisposition specifies the upload's MIME content-disposition. For example, when uploading a file from a web form, the content-disposition value is "form-data."

ContentDisposition is a Read/Write property.

Top
ContentType
Syntax
objFileUpEE.ContentType [= MIME Content-Type as String]
Description

ContentType specifies the transferred data's MIME content type (e.g., text/plain, application/msword, image/jpeg, application/pdf).

ContentType is a Read/Write property.

Top
CopyFiles
Syntax
objFileUpEE.CopyFiles(SATransferStage) [= Boolean]
Description

CopyFiles enables caching of the files to upload before sending a resumable upload request. When CopyFiles is set to true, FileUpEE will save a copy of the file to upload before sending the upload request. In a resumable upload, enabling CopyFiles guarantees that the upload will be resumable. If CopyFiles is set to false, FileUpEE will not pre-cache the files; if they are removed after a failed upload attempt, the request will not be resumable. CopyFiles is set to false by default.

When CopyFiles is enabled uploads will be slower and will require more disk space.

CopyFiles is a Read/Write property.

Example
Set oFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
oFileUpEE.TransferStage = saWebServer
oFileUpEE.CopyFiles(saWebServer) = True
oFileUpEE.Resumable(saWebServer) = True
...
Top
DbConnection
Syntax
objFileUpEE.DbConnection [= Connection String]
Description

Use DbConnection to set the database connection string when uploading files to a database or downloading files from a database.

DbConnection is a Read/Write property.

See Also
Example
objFileUpEE.DbConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=C:\Uploads\Images.mdb;" & _
    "Persist Security Info=False"
Top
DbPrimaryKey
Syntax
objFileUpEE.DbPrimaryKey [= Primary Key Column Name]
Description

DbPrimaryKey sets or returns a database table's primary key column name.

When uploading files to a database, to update a row, you must set DbPrimaryKey and DbPrimaryKeyValue. Do not set these values to add a row.

DbPrimaryKey is a Read/Write property.

See Also
Example
<% ...
objFileUpEE.DbTableName = "Files"
objFileUpEE.DbSqlCommand = "Select * from Files where FileId = 184"
objFileUpEE.DbPrimaryKey = "FileId"
objFileUpEE.DbPrimaryKeyValue = "6325"
...%>
Top
DbPrimaryKeyValue
Syntax
objFileUpEE.DbPrimaryKeyValue [= Primary Key Value]
Description

DbPrimaryKeyValue sets or returns a database record's primary key value.

When uploading a file to a database, to update a row, you must set DbPrimaryKeyValue and DbPrimaryKey. Do not set these values to add a row.

When downloading a file from database, you must set DbPrimaryKeyValue for the record containing the file.

DbPrimaryKeyValue is a Read/Write property.

See Also
Example
<% ...
objFileUpEE.DbTableName = "Files"
objFileUpEE.DbSqlCommand = "Select * from Files where FileId = 184"
objFileUpEE.DbPrimaryKey = "FileId"
objFileUpEE.DbPrimaryKeyValue = "6235"
...%>
Top
DbSqlCommand
Syntax
objFileUpEE.DbSqlCommand [= SQL Query]
Description

Use DbSqlCommand to set a SQL query when transferring files to or from a database. DbSqlCommand is a Read/Write property.

See Also
Example
<% ...
objFileUpEE.DbTableName = "Files"
objFileUpEE.DbSqlCommand = "Select * from Files where FileId = 184"
objFileUpEE.DbPrimaryKey = "FileId"
objFileUpEE.DbPrimaryKeyValue = "6325"
...%>
Top
DbTableName
Syntax
objFileUpEE.DbTableName [= Database Table Name]
Description

When uploading files to a database, set DbTableName to the destination table for your upload.

When downloading files from a database, set DbTableName to the table containing the files to download.

To set the destination table for an individual file in an upload, use FileEE.DbTableName.

DbTableName is a Read/Write property.

See Also
Example
<% ...
objFileUpEE.SaveMethod = saDatabase
objFileUpEE.DbConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
	"Data Source=C:\Uploads\files.mdb;" & _
	"Persist Security Info=False"
		
'--- DbTableName specifies the upload's destination table in the database	
objFileUpEE.DbTableName = "Images"
	
dbFileName = objFileUpEE(1).ClientFileName
	
objFileUpEE(1).DbSchema.Add "File Name", dbFileName
objFileUpEE(1).DbSchema.Add "ContentId", fileUp(1).ContentId
... %>
Top
Description
Syntax
objFileUpEE.Description [= String]
Description

Use Description to send any meta-data with the file transfer request. Description is a Read/Write property.

Example
[VBScript]
Set oFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
oFileUpEE.TransferStage = saWebServer
oFileUpEE.Description = "2-tier upload"
oFileUpEE.DestinationDirectory = Server.MapPath("/FileUpEE/samples/temp")
Set oFile = oFileUpEE.Files("myFile")
oFile.Save
...
Top
DestinationDirectory
Syntax
objFileUpEE.DestinationDirectory [= Directory Path]
Description

To save all files in a file transfer to one directory, set DestinationDirectory to the destination directory path.

If you set DestinationDirectory, set each file's DestinationFileName. Alternatively, use DestinationPath to set both the directory and file name of an individual file.

You may include or omit the destination path's ending backslash; both of the following assignments will work:

objFileUpEE.DestinationDirectory = "C:\Uploads\"
objFileUpEE.DestinationDirectory = "C:\Uploads"

DestinationDirectory is a Read/Write property.

Example
objFileUpEE.DestinationDirectory = "C:\Uploads\Images\"
objFileUpEE(0).DestinationFileName = "image1.jpg"
objFileUpEE(1).DestinationFileName = "image2.jpg"
objFileUpEE(2).DestinationFileName = "image3.jpg"
Top
DynamicAdjustScriptTimeout
Syntax
objFileUpEE.DynamicAdjustScriptTimeout(SATransferStage) [= Boolean]
Description

The default ScriptTimeout value in IIS is 90 seconds. In a file upload, the ASP page must execute for the duration of the upload. If your user is transferring information over a slow line or is transferring a large quantity of information, it is easy to exceed this limit. If DynamicAdjustScriptTimeout is set to True, the IIS ScriptTimeout value will increase automatically, as long as new data is coming from the browser.

DynamicAdjustScriptTimeout is a Read/Write property.

Note

You can either enable DynamicAdjustScriptTimeout in script, or in the Windows Registry Editor. To change the DynamicAdjustScriptTimeout registry key value:

  • From the Start menu, select Run....
  • Enter regedit and click Ok.
  • Open HKEY_LOCAL_MACHINE\SOFTWARE\SoftArtisans\FileUpEe\Parameters.
  • Right-click DynamicAdjustScriptTimeout, and select Modify.
  • In the Value data field, enter 1.
See Also

To use DynamicAdjustScriptTimeout under ASP.NET, you must set FileUpEE.Page.

Example
objFileUpEE.DynamicAdjustScriptTimeout(saWebServer)
Top
Error
Syntax
objFileUpEE.Error [= Error Message as String]
Description

Error sets or returns a FileUpEE error message.

Error is a Read/Write property.

Example
Response.Write objFileUpEE.Error
Top
ErrorLogDatabase
Syntax
objFileUpEE.ErrorLogDatabase(SATransferStage) [= Error Database Connection String]
Description

ErrorLogDatabase sets the connection string for FileUpEE's error database. FileUpEE will log errors in a database if ErrorLogDestination is set to saLogDatabase.

You can use the database FileUpEEWs.mdb for erro logging on the web server, and FileUpEEFs.mdb for error logging on the file server. Both databases are in doc-samples\Samples\UploadSamples\Intermediate\Resume\ASP. You can generate a new error log database with FileUpEE.CreateDatabase. To see the audit log, open the Errors table.

The sample databases included with FileUpEE and the databases generated by FileUpEE.CreateDatabase are Access databases. To generate a set of tables for an Oracle or SQL Server database, run the script FileUpEE.sql. The script is included in the folder SoftArtisans\FileUpEE.

ErrorLogDatabase is a Read/Write property.

Parameter

ErrorLogDatabase takes the parameter SATransferStage which specifies the stage of the upload: client -> web server or web server -> file server.

SATransferStage Values
saWebServer1
saFileServer2
See Also
Example
objFileUpEE.ErrorLogDestination(saWebServer) = saLogDatabase
objFileUpEE.ErrorLogDatabase(saWebServer) = "Provider=Microsoft.Jet.OLEDB.4.0;"&_
	"Data Source=C:\FileUpEE\FileUpEEWS.mdb;" & _
	"Persist Security Info=False"
Top
ErrorLogDestination
Syntax
objFileUpEE.ErrorLogDestination(SATransferStage) [= Error Log Type as SALogDestination]
Description

ErrorLogDestination sets the type of error logging that FileUpEE will use. By default, FileUpEE will not create an error log. To enable error logging, set ErrorLogDestination to an SALogDestination.

If ErrorLogDestination is set to saLogFile, set ErrorLogFile. If ErrorLogDestination is set to saLogDatabase, set ErrorLogDatabase.

ErrorLogDestination is a Read/Write property.

Set ErrorLogDestination to an SALogDestination:

SALogDestination Values
saNoLog0 (Default value)FileUpEE will not create an Error log.
saLogFile1Errors will be logged in the file set by the property ErrorLogFile.
saLogDatabase2Errors will be logged in a database set by the property ErrorLogDatabase.
saEventLog4Errors will be logged in the Windows EventLog. To view the errors go to Start/Control Panel/Administrative Tools/Event Viewer.
saDebugString8Errors will be logged in the system debugger. You can view the errors with tools such as Sysinternals DebugView .
Parameter

ErrorLogDestination takes the parameter SATransferStage which specifies the stage of the upload: client to web server or web server to file server.

SATransferStage Values
saWebServer1
saFileServer2
See Also
Example
objFileUpEE.ErrorLogDestination(saWebServer) = saLogDatabase
objFileUpEE.ErrorLogDatabase(saWebServer) = "Provider=Microsoft.Jet.OLEDB.4.0;"&_
	"Data Source=C:\FileUpEE\FileUpEEWS.mdb;" & _
	"Persist Security Info=False"

Top

ErrorLogFile
Syntax
objFileUpEE.ErrorLogFile(SATransferStage) [= Error Log Path as String]
Description

ErrorLogFile sets the path and file name of FileUpEE's error log file. FileUpEE will log errors in a file if ErrorLogDestination is set to saLogFile.

ErrorLogFile is a Read/Write property.

Parameter

ErrorLogFile takes the parameter SATransferStage which specifies the stage of the upload: client to web server or web server to file server.

SATransferStage Values
saWebServer1
saFileServer2
See Also
AuditLogDatabase, AuditLogDestination, AuditLogFile, ErrorLogDatabase, and ErrorLogDestination.
Example
objFileUpEE.ErrorLogDestination(saWebServer) = saLogFile
objFileUpEE.ErrorLogFile(saWebServer) = "C:\FileUpEE\ErrorLog.txt"
Top
Files
Syntax
objFileUpEE.Files
Description

Files returns the collection of files in an upload.

Files is a Read Only property.

Example
[VBScript]
Set objFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
Set FirstFile = objFileUpEE.Files(0)
FirstFile.OverwriteFile = False
FirstFile.DestinationPath = "C:\Uploads\Images\file.gif"
...
Top
FilterOn
Syntax
objFileUpEE.FilterOn(SATransferStage) [= Boolean]
Description

The value of FilterOn tells you whether or not an upload was intercepted by a FileUpEE filter (the ISAPI filter or the HttpModule). FilterOn returns true if the request was intercepted by a filter, and false if it was not. The FilterOn property can be useful for testing and troubleshooting.

FilterOn is a Read Only property.

Example
[VBScript]
Set oFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
oFileUpEE.TransferStage = saWebServer
oFileUpEE.DestinationDirectory = Server.MapPath("/FileUpEE/samples/temp")
Set oFile = oFileUpEE.Files("myFile")
oFile.Save
If oFile.Processed = saSaved Then	
  Response.Write "<h3>Upload Successful</h3>"
  Response.Write "DestinationPath: " & oFile.DestinationPath
  Response.Write "<br>"
  Response.Write "FilterOn: " & oFileUpEE.FilterOn(saWebServer)
...
Top
FileUpCompat
Syntax
objFileUpEE.FileUpCompat [= Boolean]
Description

FileUpCompat allows you to use FileUpEE with FileUp Standard Edition . You can use FileUpEE to create a 3-tier upload (client to web Server to file server) without rewriting your existing FileUpSE script.

A FileUpSE upload application includes a client-side file submission script and a server-side script that uses FileUpSE to process the upload:

In a 3-tier FileUpEE upload, if FileUpCompat is set to true on the web server, you can use a FileUpSE script on the file server:

When you use an existing FileUpSE script on the file server, in your web server script:

  1. Set FileUpCompat to true.
  2. Call ProcessRequest.
  3. Set TargetUrl.
  4. Call SendRequest.

FileUpCompat is a Read/Write property.

Example

The following is from a web server script in a 3-tier upload that uses FileUpSE on the file server:

[VBScript]
Set oFileUpEE = Server.CreateObject("SoftArtisans.FileUpEe"))
oFileUpEE.FileUpCompat = True
oFileUpEE.ProcessRequest Request, False, False
objFileUpEE.TargetUrl = "http://localhost/fileupeescripts/fs.asp"
objFileUpEE.SendRequest(Response)
Top
Form
Syntax
objFileUpEE.Form
Description

Form returns the collection of elements (name/value pairs) uploaded from an HTML form, excluding files.

Form is a Read Only property.

The Form collection has three properties:

Form Properties
CountReturns the number of form elements (excluding files) in an uploaded HTML form.
ExistsReturns True if a specified form element exists, False if it does not.
ItemRepresents a single form element in a Form collection. Item is the default property of Form, therefore, Form(2) is equivalent to Form.Item(2).

Item takes a key and returns a form element. The key is the form element's name (the value of its HTML NAME attribute), or number (Item numbers are 0-based).
Is the form element a string or a collection?

Use the following methods to determine whether a member of the Form collection is a string (e.g., a radio button value) or a collection (e.g., a set of check box values).

  • Checking in ASP with VBScript

    In ASP, a collection of elements is an object. Therefore, to determine whether a form element is a string or a collection, use IsObject to check if the form element's value is an object. For example:

    For each item in objFileUpEE.Form
    Response.Write "Name: " & item.Name
    Response.Write "<br>"
    Response.Write "Value: " 
    If IsObject(item.Value) then
    	For each subitem in item.Value
    		Response.Write "<br>"
    		Response.Write "&nbsp;&nbsp; Name: " & subitem.Name
    		Response.Write "<br>"
    		Response.Write "&nbsp;&nbsp; Value: " & subitem.Value 
    	Next
    Else
    	Response.Write item.Value
    End if 
    	Response.Write "<br>"
    Next
  • Checking in ASP.NET with C#

    In ASP.NET check if a form element's value is String to determine wheter the element is a single element or a collection. Example:

    ForEach(SaDictionary objElem in fileUp.Form)
    {
    if(objElem.Value is String)
    	{
    	Page.Response.Write("Name:");
    	Page.Response.Write(objElem.Name);
    	Page.Response.Write("Value:");
    	Page.Response.Write(objElem.Value);
    	}
    else
    	{
    	Page.Response.Write("Name:");
    	Page.Response.Write(strName);
    	Page.Response.Write("Value:");
    	Page.Response.Write("<br>");
    	Page.Response.Write("Sub Array:");
    	foreach(SaDictionary objSubElem in (IEnumerable)objElem.Value)
    		{
    		Page.Response.Write("Name:");
    		Page.Response.Write(objSubElem.Name);
    		Page.Response.Write("Value:");
    		Page.Response.Write(objSubElem.Value);
    		Page.Response.Write("<br>");
    		}
    	}
         Page.Response.Write("<br>");
    }
Top
HostPort
Syntax
objFileUpEE.HostPort [=Port Number]
Description

Specifies the port that the web server will use to connect to the file server. The default value of HostPort is 80. This property has no effect on what port the web server will use for client requests.

HostPort is a Read/Write property.

Top
HttpResponse
Syntax
objFileUpEE.HttpResponse
Description

HttpResponse returns an instance of HttpParams that represents the HTTP/SOAP response from the previous stage of a file transfer. For example, in a 3-tier upload from client to web server to file server, HttpResponse on the web server represents the response from the file server to the web server.

HttpParams Properties
BodyTextIf the response from the next stage is not a SOAP response, you can use BodyText to get the HTTP response. Example:
oFileUpEE.HttpResponse.BodyText
HeaderReturns the value of a specified HTTP header. Example:
oFileUpEE.HttpResponse.Header("content-type")
HeadersReturns all HTTP response headers. Example:
oFileUpEE.HttpResponse.Headers
StatusReturns an HTTP status code. Example:
oFileUpEE.HttpResponse.Status

HttpResponse is a Read Only property.

Top
Item
Syntax
objFileUpEE[.Item](Key)
Description

Item represents a single file in a file transfer. Item is the default property of FileUpEE, so objFileUpEE(2) is equivalent to objFileUpEE.Item(2).

Item numbers are 0 based.

Item takes a key and returns a FileEE object.

Example
'--- Save the first file in an upload to a directory
objFileUpEE(0).SaveMethod = saDiskFile
objFileUpEE(0).DestinationFileName = "C:\Uploads\Images\image.jpg"
objFileUpEE(0).OverwriteFile = True
Top
JobId
Syntax
objFileUpEE.JobId [= JobId as String]
Description

In a resumable upload, FileUpEE generates a unique JobId for each upload (not for each file). If the upload is suspended, the upload's JobId and information about the incomplete upload will be stored in an upload status database. You can then call Resume to resume the upload.

The Resume method takes an upload's JobId and uses it to get the suspended upload's status from the database. Resume then continues the upload from the point at which it stopped.

JobId is a Read/Write property.

Example

In a standard 3-tier upload (client to web server to file server), there are three scripts: the client-side file submission script, the web server script, and the file server script. A resumable upload has two additional scripts: a resume-upload script and a status server script.

If the upload from web server to file server is suspended, and the user clicks a Resume link/button, the resume-upload script will be called. When the Resume method (within the resume-upload script) is called, a request will be made to the status server script. The response will tell FileUpEE the point at which the upload was suspended.

The following lines from the web server script create a link to the resume-upload script (send.asp). The query string includes the JobId which the Resume method will need to get the status of the suspended upload.

[VBScript]
...
On error resume next
numRetVal = objFileUpEE.SendRequest()
'--- If the upload from web server to file server
'--- is suspended because of a network error, display 
'--- a "Resume upload" link to send.asp.
If err.number <> 0 then
	Response.Write "<h2>Upload Failed</h2><br>"
	Response.Write objFileUpEE.Error 	
	Response.write "<br><a href=send.asp?JobId=" & objFileUpEE.JobId &_ 
			">Resume upload</a>"
	Response.End
End if
...	

In the resume-upload script (send.asp), Resume takes the upload's JobId and makes a request to the status server which returns the number of bytes received on the file server. Resume then continues the upload from the point at which it stopped.

[VBScript]
...
'--- The Resume method takes the JobId sent from ws.asp
'--- and resumes the upload from the point at which it 
'--- stopped.
objFileUpEE.Resume(Request.QueryString("JobID"))
...
Top
MaxKBytes
Syntax
objFileUpEE.MaxKBytes(SATransferStage) [= Upload size limit in Kilobytes as Double]
Description

MaxKBytes sets a file size limit for an upload. MaxKBytes is a per-file limit, not a limit for a whole multiple-file upload. For each file in an upload, FileUpEE will stop writing the file to disk at the value of MaxKBytes. Note that incomplete files will be saved.

In a client to web server to file server upload, you can set two upload size limits: a limit for the web server and a limit for the file server. The parameter SATransferStage specifies whether the size limit is for the web server or file server.

When MaxKBytes is set to zero, there is no size limit for uploaded files. MaxKBytes is set to zero by default.

To take effect, MaxKBytes(saWebServer) must be set before ProcessRequest is called on the web server. MaxKBytes(saFileServer) must be set before ProcessRequest is called on the file server.

MaxKBytes is a Read/Write property.

Parameter

MaxKBytes takes the parameter SATransferStage which specifies the stage of the upload: client to web server or web server to file server.

SATransferStage Values
saWebServer1
saFileServer2
Example

The following is from the web server script in an upload from browser to web server to file server:

[VBScript]
Set objFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
objFileUpEE.MaxKBytes(saWebServer) = 500000
objFileUpEE.ProcessRequest Request, True, True
...
Top
MaxKBytesToCancel
Syntax
objFileUpEE.MaxKBytesToCancel(SATransferStage) [= File size limit in Kilobytes as Double]
Description

FileUpEE will abort a file upload when the size of the transfer reaches the value of MaxKBytesToCancel. No data will be written to the server's hard disk, the connection will be terminated, and the browser will display a "Page not found" message.

Setting MaxKBytesToCancel may reduce the threat of a DoS (Denial of Service) attack on the file server. When an upload size hits MaxKBytesToCancel, the connection to the server will be terminated, the ASP/ASP.NET page will finish executing, and the ASP/ASP.NET thread will be freed.

In a client to web server to file server upload, you can set one of two upload size limits: a limit for the web server or a limit for the file server. The parameter SATransferStage specifies whether the size limit is for the web server or file server.

To take effect, MaxKBytesToCancel(saWebServer) must be set before ProcessRequest is called on the web server. MaxKBytesToCancel(saFileServer) must be set before ProcessRequest is called on the file server.

MaxKBytesToCancel is a Read/Write property.

Parameter

MaxKBytesToCancel takes the parameter SATransferStage which specifies the stage of the upload: client to web server or web server to file server.

SATransferStage Values
saWebServer1
saFileServer2
Example

The following is from the file server script in an upload from browser to web server to file server:

[VBScript]
Set objFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
'--- Set MaxKBytesToCancel before calling ProcessRequest.
objFileUpEE.MaxKBytesToCancel(saFileServer) = 500000
objFileUpEE.ProcessRequest Request, True, True
...
Top
OverwriteFiles
Syntax
objFileUpEE.OverwriteFiles [= Boolean]
Description

When OverwriteFiles set to true, an uploaded file will overwrite an existing file with the same name. When OverwriteFiles is set to false, an uploaded file will not be saved if a file with the same name exists.

OverwriteFiles is a Read/Write property, and is set to true by default.

See Also

To set this property for individual files, rather than the whole upload, use FileEE.OverwriteFile.

Top
Page

Syntax
objFileUpEE.Page [Page]
Description

Use the Page property with DynamicAdjustScriptTimeout under ASP.NET.

If DynamicAdjustScriptTimeout is set to true - either in script or in the registry - you must pass the ASP.NET Page object to FileUpEE. Pass the Page object to FileUpEE either,

  • In FileUpEE's constructor:
    FileUpEe pFileUpEe = new FileUpEe(Page);


  • OR

  • Through the Page property:
    pFileUpEe.Page = Page;

When DynamicAdjustScriptTimeout is set to true, if you do not pass the Page reference to FileUpEE, the request will not fail, but DynamicAdjustScriptTimeout will not be enabled.

Top
PerConnectionBandwidthLimit

Syntax
objFileUpEE.PerConnectionBandwidthLimit(SATransferStage) [= Bandwidth Limit in Kilobytes per Second as Long]
Description

PerConnectionBandwidthLimit limits each download connection to a specific bandwidth in kilobytes per second. If this property is set, each download will not exceed the designated speed.

Example
[VBScript]
Set Download = Server.CreateObject("SoftArtisans.FileUpEE")
'--- Set bandwidth limit to 10-KB per second
Download.PerConnectionBandwidthLimit = 10 
'--- Start the download
Download.TransferFile Request, Response, "C:\Images\image.gif"
Top
PerServerBandwidthLimit

Syntax
objFileUpEE.PerServerBandwidthLimit(SATransferStage) [= Bandwidth Limit in Kilobytes per Second as Long]
Description

When used in a download, PerServerBandwidthLimit will limit the total server output to a specific bandwidth in kilobytes per second. If PerServerBandwidthLimit is set, the total speed of the server's output for all connections combined will not exceed the designated limit. Each connection will get a proportion of bandwidth based on the total bandwidth available, divided by the number of current connections.

Example
[VBScript]
Set Download = Server.CreateObject("SoftArtisans.FileUpEE")
'--- Set the server output bandwidth limit to 1000 KB per 
'--- second for all connections combined
Download.PerServerBandwidthLimit = 1000 
'--- Start the download
Download.TransferFile Request, Response, "C:\Images\image.gif"
Top
PreserveMacBinary
Syntax
objFileUpEE.PreserveMacBinary [= Boolean]
Description

If PreserveMacBinary is set to true, files uploaded from a Macintosh will be saved in MacBinary format. If this property is set to false, the data fork will be extracted and saved as the uploaded file. PreserveMacBinary is set to false by default.

PreserveMacBinary is a Read/Write property.

Example
objFileUpEE.PreserveMacBinary = True
Top
ProgressId
Syntax
objFileUpEE.ProgressId(SATransferStage) [= Long]
Description

ProgressId sets or returns an ID number for an upload that is being monitored by FileUpEE's progress indicator.

ProgressId is a Read/Write property.

Parameter

FileUpEE's progress indicator can monitor uploads from client to web server, and from web server to file server. The progress from client to web server is measured as the number of bytes received on the web server. Progress from web server to file server is measured as the number of bytes sent from the web server (note that this is not proof of arrival on the file server).

ProgressId takes the parameter SATransferStage which specifies the stage of the upload: client to web server or web server to file server.

SATransferStage Values for ProgressId
saClient0Upload to web server
saWebServer1Upload from web server
Example

The following is from the web server script in a 3-tier upload (client to web server to file server) application with a progress indicator.

[VBScript]
Dim objFileUpEE
Set objFileUpEE = Server.CreateObject("SoftArtisans.FileUpEe")
objFileUpEE.TransferStage = saWebServer
'--- Enable the progress indicator for both stages of the upload.
objFileUpEE.ProgressIndicator(saClient) = True
objFileUpEE.ProgressIndicator(saWebServer) = True
'--- Set the ProgressIds for each stage to the ProgressId values 
'--- sent in the QueryString.
objFileUpEE.ProgressId(saClient) = cint(Request.QueryString("progressid"))
objFileUpEE.ProgressId(saWebServer) = cint(Request.QueryString("WSprogressid"))
...	
Top
ProgressIndicator
Syntax
objFileUpEE.ProgressIndicator(SATransferStage) [= Boolean]
Description

Set ProgressIndicator to true to turn on progress logging for the specified upload transfer stage. ProgressIndicator is set to false by default.

If you are using the ISAPI filter, ProgressIndicator must be enabled - set to 1 - in the registry.

ProgressIndicator is a Read/Write property.

Example

The following is from the web server script in a 3-tier upload (client to web server to file server) application with a progress indicator.

[VBScript]
Dim objFileUpEE
Set objFileUpEE = Server.CreateObject("SoftArtisans.FileUpEe")
objFileUpEE.TransferStage = saWebServer
'--- Enable the progress indicator for both stages of the upload.
objFileUpEE.ProgressIndicator(saClient) = True
objFileUpEE.ProgressIndicator(saWebServer) = True
'--- Set the ProgressIds for each stage to the ProgressId values 
'--- sent in the QueryString.
objFileUpEE.ProgressId(saClient) = cint(Request.QueryString("progressid"))
objFileUpEE.ProgressId(saWebServer) = cint(Request.QueryString("WSprogressid"))
...	
Top
ReceiveTimeout
Syntax
objFileUpEE.ReceiveTimeout [= Timeout in Seconds as Long]
Description

ReceiveTimeout sets a time-out value, in seconds, for receiving a response to a request. If a response takes longer than this value, the request will be cancelled. The default value of ReceiveTimeout is 40 seconds.

ReceiveTimeout is a Read/Write property.

Example
objFileUpEE.ReceiveTimeout = 60

Top

RequestTimeout
Syntax
objFileUpEE.RequestTimeout(SATransferStage) [= Timeout in Seconds as Long]
Description
RequestTimeout sets a time, in seconds, at which a file transfer request will be killed, whether it is finished or not. The default value of RequestTimeout is 40 seconds.

RequestTimeout is a Read/Write property.

Parameter

RequestTimeout takes the parameter SATransferStage which specifies the stage of the upload: client to web server or web server to file server.

SATransferStage Values
saWebServer1
saFileServer2
Example
objFileUpEE.RequestTimeout(saWebServer) = 60

Top

ResolveTimeout
Syntax
objFileUpEE.ResolveTimeout [= Timeout in Seconds as Long]
Description

ResolveTimeout sets a time-out value, in seconds, to use for name resolution. Name resolution is the process of obtaining a TCP/IP address from a host name (such as softartisans.com). If resolution takes longer than the value of ResolveTimeout, the action is cancelled. The default value of ResolveTimeout is 40 seconds.

ResolveTimeout is a Read/Write property.

Example
objFileUpEE.ResolveTimeout = 60
Top
Resumable
Syntax
objFileUpEE.Resumable(SATransferStage) [= Boolean]
Description

When Resumable is set to true, FileUpEE will be able to resume an upload that was suspended because of a network connection failure, or because the upload size was greater than MaxKBytesToCancel. Resumable is set to false by default.

Resumable takes the parameter SATransferStage which specifies the stage of the upload: client to web server or web server to file server. In a 3-tier upload from an HTML form (browser to web server to file server), FileUpEE can resume the upload if it was suspended between web server and file server. If you use XFile to upload from the client, FileUpEE can also resume the upload if it was suspended between client to web server. In a 3-tier upload, you must set Resumable to true for both the web server and the file server.

Set Resumable before calling ProcessRequest.

If you are using the ISAPI filter, Resumable must be enabled - set to 1 - in the registry.

Resumable is a Read/Write property.

Parameter

Resumable takes the parameter SATransferStage which specifies the stage of the upload: client to web server or web server to file server.

SATransferStage Values
saWebServer1
saFileServer2
Example

The following lines are from the web server script in a resumable 3-tier upload (client -> web server -> file server) application.

[VBScript]
Dim objFileUpEE
Set objFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
'--- Set the upload's transfer stage to saWebServer. 
objFileUpEE.TransferStage = saWebServer
'--- Enable resumable upload on the web server.  
objFileUpEE.Resumable(saWebServer) = True
'--- Enable resumable upload on the file server.  
objFileUpEE.Resumable(saFileServer) = True
'--- Set the connection string for the web server's 
'--- upload status database. 
objFileUpEE.ResumeConnectionString(saWebServer) = "Provider=" &_
	"Microsoft.Jet.OLEDB.4.0;Data Source=" & _
	Server.MapPath(Application("vroot") & "FileUpEEWS.mdb") & _ 
	";Persist Security Info=False"
'--- Set the connection string for the file server's 
'--- upload status database. 
objFileUpEE.ResumeConnectionString(saFileServer) = "Provider=" &_
	"Microsoft.Jet.OLEDB.4.0;Data Source=" & _
	Server.MapPath(Application("vroot") & "FileUpEEFS.mdb") & _ 
	";Persist Security Info=False"
'--- Pass the Request object to FileUpEE.
objFileUpEE.ProcessRequest Request
....
Top
ResumeConnectionString
Syntax
objFileUpEE.ResumeConnectionString(SATransferStage) [= Connection String]
Description

In a resumable upload, if the upload is suspended - because of a network connection failure, or because the upload size was greater than MaxKBytesToCancel - FileUpEE will save information about the incomplete upload in an upload status database. ResumeConnectionString sets the connection string for the upload status database.

A resumable 3-tier upload (client to web server to file server) application uses two status databases, one on the web server and one on the file server. In the web server script, set ResumeConnectionString for both web server and file server. In the file server script set ResumeConnectionString for the file server. Set ResumeConnectionString before calling ProcessRequest.

ResumeConnectionString is a Read/Write property.

Parameter

ResumeConnectionString takes the parameter SATransferStage which specifies the stage of the upload: client to web server or web server to file server.

SATransferStage Values
saWebServer1
saFileServer2
Example

The following lines are from the file server script in a resumable 3-tier upload (client -> web server -> file server) application.

[VBScript]
Dim objFileUpEE
Set objFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
'--- Set the upload's transfer stage to saFileServer. 
objFileUpEE.TransferStage = saFileServer
'--- Enable resumable upload on the file server.  
objFileUpEE.Resumable(saFileServer) = True
'--- Set the connection string for the file server's 
'--- upload status database. If the upload to the file 
'--- server stops before all the data is transferred, 
'--- FileUpEE will enter upload status information in 
'--- this database.  To resume the upload, FileUpEE 
'--- reads the status of the suspended upload from this 
'--- database.
objFileUpEE.ResumeConnectionString(saFileServer) = "Provider=" &_
	"Microsoft.Jet.OLEDB.4.0;Data Source=" & _
	Server.MapPath(Application("vroot") & "FileUpEEFS.mdb") & _ 
	";Persist Security Info=False"
'--- Pass the request from the web server to FileUpEe.
objFileUpEe.ProcessRequest Request, True, True
'--- Send the file server response to the web server.
objFileUpEE.SendResponse Response
Top
SaveMethod
Syntax
objFileUpEE.SaveMethod [= saSaveMethod]
Description

SaveMethod specifies whether uploaded files will be saved to a file directory or in a database. SaveMethod is a Read/Write property.

Set SaveMethod to an saSaveMethod by name or number:

saSaveMethod Values
saDatabase0
saDiskFile1 (Default value)
See Also
Example
[VBScript]
...
objFileUpEE.SaveMethod = saDatabase
objFileUpEE.DbConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
	"Data Source=C:\Uploads\files.mdb;" & _
	"Persist Security Info=False"	
objFileUpEE.DbTableName = "Images"
dbFileName = objFileUpEE.ClientFileName
objFileUpEE(1).DbSchema.Add "File Name", dbFileName
... 
Top
SendTimeout
Syntax
objFileUpEE.SendTimeout[= Timeout in Seconds as Long]
Description

SendTimeout sets a time-out value, in seconds, to use for sending requests. If sending a request takes longer than this value, the send will be cancelled. The default value of SendTimeout is 40 seconds.

Example
objFileUpEE.SendTimeout = 60
Top
StatusUrl
Syntax
objFileUpEE.StatusUrl [=URL]
Description

In a standard 3-tier upload (client to web server to file server), there are three scripts: the client-side file submission script, the web server script, and the file server script. A resumable upload has two additional scripts: a resume-upload script (on the web server) and a status server script (on the file server).

If the upload from web server to file server is suspended, and the user clicks a Resume link/button, the resume-upload script will be called. When the Resume method is called (within the resume-upload script), a request will be made to the status server script. The response will tell FileUpEE the point at which the upload was suspended.

StatusUrl specifies the URL of the status server script. You can set StatusUrl in the web server script, before calling SendRequest, or in the resume-upload script, before calling Resume.

Example

The status database and the status script are on the file server. You can set StatusUrl in the web server script, before calling SendRequest, or in the resume-upload script, before calling Resume.

'--- Set the status URL on the file server.  If the 
'--- upload is suspended, and the user click's "Resume,"  
'--- status.asp will return the status of the suspended 
'--- upload.  The Resume method will restart the upload 
'--- from the point at which it stopped. 
objFileUpEE.StatusUrl = "http://localhost/fileupee/status.asp"
Top
StreamRequest
Syntax
objFileUpEE.StreamRequest [= Boolean]
Description

In a 3-tier upload (client to web server to file server), FileUpEE can stream the files submitted from the client directly to the file server, without writing temporary files on the web server. The advantages of a streamed upload are:

  • Improved performance: No temporary files are written on the web server.
  • Security: The uploaded files are never on the web server in their complete form, either in memory or on disk.

To stream an upload request to the file server:

  1. On the web server, set StreamRequest to true before calling ProcessRequest.

    The ProcessRequest method passes the request to FileUpEE. By default, FileUpEE does not stream uploads to the file server and will start writing the upload to temporary files when you call ProcessRequest on the web server. Therefore, setting StreamRequest to true after calling ProcessRequest has no effect. You must tell FileUpEE to stream the request before FileUpEE processes the request.

  2. On the web server, set properties that affect how the files will be uploaded from web server to file server before calling ProcessRequest. For example, set TargetURL, MaxKBytes(saFileServer), and TempStorageLocation(saFileServer) before calling ProcessRequest.

    If StreamRequest is set to true, FileUpEE will start streaming the upload to the file server when ProcessRequest is called. Therefore, before calling ProcessRequest, you must set properties that determine how the files will be uploaded from web server to file server. For example, FileUpEE must know where the upload request is going before streaming the request, so set TargetURL before calling ProcessRequest.

To access form values in the client upload request, you must first call ProcessRequest. Therefore, if - on the web server - you want to get information submitted from the client before setting TargetURL, you cannot stream the request to the file server. For example, if you want to check the content-type of the uploaded file before setting the upload's TargetURL, you will have to set TargetURL after ProcessRequest, making a streamed upload impossible.

StreamRequest is a Read/Write property.

Notes

StreamRequest property is not supported in ASP.NET.

FileUpEE's streamed upload does not comply with the specification for SOAP Messages with Attachments , so it will not interoperate with the Java implementation of SOAP with Attachments in JAXM.

Example
Set oFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
oFileUpEE.TransferStage = saWebServer
'--- Set StreamRequest to True before calling ProcessRequest on 
'--- the web server and before setting properties that take effect 
'--- between SendRequest on the web server 
'--- and ProcessRequest on the file server.
oFileUpEE.StreamRequest = True
oFileUpEE.TargetUrl = "http://localhost/FileUpEE/StreamUpload/fileserver.asp"
oFileUpEE.ProcessRequest Request, False, False
....
Top
TargetUrl
Syntax
objFileUpEE.TargetUrl [= URL]
Description

Set TargetUrl to the page to which FileUpEE will submit a server-to-server request. TargetUrl is a Read/Write property.

Example

When submitting an upload from a web form to a web server to a file server, set TargetUrl to the destination page on the file server. So, if the web form submits to webserver.asp, and the processing page on the file server is fileserver.asp, set TargetUrl on webserver.asp to the URL of fileserver.asp.

objFileUpEE.TargetUrl = "http://www.fileserver.com/fileserver.asp"
Top
TempStorageLocation
Syntax
objFileUpEE.TempStorageLocation(SATransferStage) [= Temp Directory]
Description

When an upload reaches the web server or the file server, the upload is cached. TempStorageLocation sets the cache directory on the specified server. If you do not assign a value to TempStorageLocation, uploads will be cached in the system's default directory for cached files, which is determined by the system environment variable TEMP.

To take effect, TempStorageLocation(saWebServer) must be set before ProcessRequest is called on the web server. TempStorageLocation(saFileServer) must be set before ProcessRequest is called on the file server.

You may include or omit the temp path's ending backslash; both of the following assignments will work:

objFileUpEE.TempStorageLocation(saWebServer) = "C:\Temp\"
objFileUpEE.TempStorageLocation(saWebServer) = "C:\Temp"	

TempStorageLocation is a Read/Write property.

The ISAPI filter caches the upload before the ASP or ASP.NET script is executed. Therefore, if you are using the ISAPI filter, assign a temporary storage location by setting the registry key IsapiTempDir.

Parameter

TempStorageLocation takes the parameter SATransferStage which specifies whether to set the directory on the web server or file server. Note that FileUpEE will cache files on both the web server and the file server.

SATransferStage Values
saWebServer1
saFileServer2
Note

To change the system's default directory for cached files, reset the TEMP environment variable, as follows:

  • Open the Control Panel.
  • Select System.
  • Select the Advanced tab.
  • Click Environment variables...
  • Select TEMP from the System Variables list.
  • Click Edit.
  • Enter a new Variable Value, and click Ok.
Example
[VBScript]
Set objFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
'--- Set TempStorageLocation before calling 
'--- ProcessRequest.
objFileUpEE.TempStorageLocation(saWebServer) = "c:\upload\temp"
objFileUpEE.ProcessRequest Request

Top

TransferEncoding
Syntax
objFileUpEE.TransferEncoding(SATransferStage) [= SATransferEncoding]
Description

To overcome inefficient memory utilization in IIS 6 on Windows 2003, FileUpEE allows you to send a chunked upload. To send a chunked upload, set TransferEncoding to saChunked. In this case, the HTTP request will not include a content-length header for the whole request. Instead, each chunk is preceded by a header that indicates the chunk size.

When uploading in ASP.NET to IIS 6, set TransferEncoding to saChunked and use FileUpEE's HttpModule to intercept the upload request.

Browsers do not support chunked transfer-encoding. To send a chunked upload from client to web server you must use XFileEE, a client-side control included with FileUpEE.

TransferEncoding is a Read/Write property. Set the value of SATransferEncoding by name or number:

SATransferEncoding Values
saNone (default value)0
saChunked1
Note
Do not set TransferEncoding to saChunked if you are using the ISAPI filter. The ISAPI filter cannot handle chunked requests.
Example
[VBScript]
Set oFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
oFileUpEE.TransferStage = saWebServer
oFileUpEE.TransferEncoding(saWebServer) = saChunked
...
	

Top

TransferStage
Syntax
objFileUpEE.TransferStage [= SATransferStage]
Description

TransferStage specifies the stage of an upload, which may be either web server or file server. Set TransferStage by name or number:

SATransferStage Values
saWebServer1
saFileServer2

TransferStage is a Read/Write property.

Example

Set a script's TransferStage before calling ProcessRequest:

[VBScript]
Set objFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
'--- Set the upload's transfer stage to saWebServer. 
objFileUpEE.TransferStage = saWebServer
objFileUpEE.ProcessRequest Request

Top

UseChecksum
Syntax
objFileUpEE.UseChecksum [= Boolean]
Description

UseChecksum allows you to verify the integrity of data uploaded from web server to file server. If UseChecksum is set to true on the web server, FileUpEE will generate a file content checksum for the upload and send the checksum with the upload to the file server. On the file server, use ValidateChecksums to verify that the data was not corrupted during transfer.

In very large uploads, generating a checksum for each file can take so long that the upload may fail. Enabling UseChecksum is not recommended for very large uploads.

UseChecksum is a Read/Write property.

See Also

You can generate and validate a content checksum for a single file or for the whole upload. For information on using per-file checksums, see FileEE.Checksum, FileEE.PreviousChecksum, FileEE.UseChecksum, and FileEE.ValidateChecksum.

Top
UseMemory
Syntax
objFileUpEE.UseMemory(SATransferStage) [= Boolean]
Description

If UseMemory is set to true, FileUpEE will store data uploaded to the specified server in memory until the data is saved. If UseMemory is set to false, data uploaded to the specified server will be cached in a temporary directory until it is saved. UseMemory is set to false by default.

The benefits of caching in memory may be:

  • Security
    No files are written to disk until the upload is saved.


  • Performance
    Caching files in memory can increase the speed of uploads. However, before setting UseMemory to True you should consider other factors affecting the upload, such as, available memory on the file server, how active the server is, and the size of the upload. If an upload is larger than 1-5 MB (depending on the system load), caching in memory will probably not improve performance.

Do not set UseMemory to True if you expect very large uploads (100 MB or more).

To take effect, UseMemory(saWebServer) must be set before ProcessRequest is called on the web server. UseMemory(saFileServer) must be set before ProcessRequest is called on the file server.

UseMemory is a Read/Write property.

Parameter

UseMemory takes the parameter SATransferStage which specifies whether to cache in memory on the web server or file server. Note that FileUpEE will cache files on both the web server and the file server.

SATransferStage Values
saWebServer1
saFileServer2
Note on UseMemory and the FileUpEE Filters

FileUpEE's UseMemory property allows you to keep uploaded data in memory until it is saved. FileUpEE's ISAPI filter and HttpModule read the whole upload request and write it to temporary files before the request is processed by the ASP or ASP.NET page on the server. If you set UseMemory in the ASP/ASP.NET page, the property will have no effect because the page is processed after the filter writes the temp files. To set UseMemory when using a FileUpEE filter, include the property in the request query string, as in the following lines from an upload request script:

<SCRIPT Language="JavaScript">
function startupload() {
	document.theForm.action="formresp.upl?usememory=true";
	}
</script>
...
<FORM onSubmit="startupload();" name="theForm" ACTION="formresp.upl" 
ENCTYPE="MULTIPART/FORM-DATA" METHOD="POST">
...
Example
objFileUpEE.UseMemory(saWebServer) = True
Top


FileUpEe Methods
Add
Syntax
objFileUpEE.Add(FileBuffer, [Name], [ContentId])
Description

Adds a file to the FileCollection. The source of this file is a byte array.

You can use Add to upload a file from server to server.

Top
AddDbDownloadFile
Syntax
objFileEE = objFileUpEE.AddDbDownloadFile(ClientFileName, [Name],[WebServerDownload as Boolean])
Description

AddDbDownloadFile adds a file from a database to the collection of files to download. AddDbDownloadFile takes the download destination file name and returns a FileEE object.

To download a file from a database, you must set the file's table name, primary key column, primary key value, file column name, and the database connection string.

Parameters
ClientFileName A destination name of the downloaded file. This file name will appear in the "Open or Save" dialog on the client.
Name Optional. The value of name may be used to reference the file in script, for example:

objFileUpEE("file1").ContentType = "text/plain"

Default value:
""
WebServerDownload Optional. To script a download from a file server to a web server to a client, set WebServerDownload to false. To script a download from a web server to a client, set WebServerDownload to true. Default value:
false
See Also
Example

The following web server script gets the download destination directory from the form field "Client."

[VBScript]
Dim objFileUpEE
Set objFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
objFileUpEE.ProcessRequest Request
objFileUpEE.AddDbDownloadFile fileUp.Form("Client")
objFileUpEE(0).DbTableName = "Files"
objFileUpEE(0).DbPrimaryKey = "FileId"
objFileUpEE(0).DbPrimaryKeyValue = "260"
objFileUpEE(0).DbFileColumnName = "File" 
objFileUpEE(0).DbConnection = "Provider=Microsoft.Jet.OLEDB.4.0; _
	Data Source=C:\FilesDB\files.mdb; Persist Security Info=False"
objFileUpEE.TargetUrl = "http://localhost/fileupee/dbdownload/fsDownDb.asp"  
objFileUpEE.SendRequest(Response)
Top
AddDownloadFile
Syntax
objFileEE = objFileUpEE.AddDownloadFile(DownloadPath, ClientPath, [Name], [WebServerDownload as Boolean])
Description

AddDownloadFile adds a file to the collection of files to download.

Parameters
DownloadPath The path and name of the file to download.
ClientPath A destination name for the downloaded file. This file name will appear in the "Open or Save" dialog on the client.
Name Optional. The value of name may be used to reference the file in script, for example:

objFileUpEE("file1").ContentType = "text/plain"

Default value:
""
WebServerDownload Optional. To script a download from a file server to a web server to a client, set WebServerDownload to false. To script a download from a web server to a client, set WebServerDownload to true. Default value:
false
Note

In a 3-tier download from file server to web server to client, files cannot be added to the FileUpEE.Files collection on the file server. If you want to set the source path of the file to download on the file server, the file should be added on the web server using AddDownloadFile with an empty string for the download source path, for example:

Set oFile = oFileUpEE.AddDownloadFile("","","file1")

On the file server, set the download source an destination paths, for example:

oFileUpEE(0).DownloadedPath = "C:\images\image.jpg"
oFileUpEE(0).ClientFileName = oFileUpEE.Form("Client")
Example

The following web server script gets the download's source and destination directories from the form fields "Download" and "Client."

[VBScript]
Set objFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
objFileUpEE.ProcessRequest Request	
objFileUpEE.AddDownloadFile objFileUpEE.Form("Download"), _
	objFileUpEE.Form("Client")	
objFileUpEE.TargetUrl = "http://localhost/fileupee/download/fsDown.asp"
enumRetVal = objFileUpEE.SendRequest(Response)
Top
AddFile
Syntax
objFileUpEE.AddFile(FileName, [Name], [ContentId])
Description

Use AddFile to add a file from the file system to the collection of files to upload.

You can use AddFile to upload a file from server to server.

Parameters
FileName File path and name
Name Optional. Equivalent to FileEE.Name. The name assigned can be used as the file's key. For example,
objFileUpEE.AddFile "C:\first.xls","AddedFile",1234
objFileUpEE("AddedFile").OverwriteFile = False
objFileUpEE("AddedFile").DestinationPath = "C:\Images\file.gif"
...
ContentId Optional. Equivalent to FileEE.ContentId. FileUpEE will automatically generate a unique content-ID for each file uploaded, unless a content-ID is assigned in script, as in the following example:
objFileUpEE.AddFile "C:\first.xls","AddedFile","1234"
Default value: "" (In this case FileUpEE will generate a content-ID.)
Example
[VBScript]
Set objFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
objFileUpEE.ProcessRequest Request
objFileUpEE.AddFile "C:\first.xls","AddedFile",1234
objFileUpEE("AddedFile").OverwriteFile = False
objFileUpEE("AddedFile").DestinationPath = "C:\Images\file.gif"
...
Top
CreateDatabase
Syntax
objFileUpEE.CreateDatabase(DatabasePath as String)
Description

CreateDatabase creates a FileUpEE database at the location specified by DatabasePath. The generated FileUpEE database can be used as:

CreateDatabase generates a Microsoft Access database (a .mdb file); the file name specified in DatabasePath should have the extension .mdb. MS Access does not have to be installed for FileUpEE to generate or use the database.

Example
The following lines create a FileUpEE database, and use it as an upload status database for resumable uploading.
[VBScript]
Set oFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
oFileUpEE.TransferStage = saWebServer
oFileUpEE.CreateDatabase("D:\FileUpEE\UploadStatus\uploads.mdb")
objFileUpEE.Resumable(saWebServer) = True
objFileUpEE.ResumeConnectionString(saFileServer) = "Provider=" &_
	"Microsoft.Jet.OLEDB.4.0;Data Source=" & _
	"D:\FileUpEE\UploadStatus\uploads.mdb" & _ 
	";Persist Security Info=False"
...
Top
Dispose
Syntax
objFileUpEE.Dispose()
Description

When you are finished using an instance of FileUpEE under .NET, always call Dispose to ensure thorough cleanup of temporary files.

Example
[VB.NET]
Finally
	If Not (oFileUpEE Is Nothing) Then
	  oFileUpEE.Dispose()
	End If
	oFileUpEE = Nothing
End Try
Top
NextProgressId
Syntax
objFileUpEE.NextProgressId(SATransferStage)
Description

FileUpEE includes a server-side progress indicator that allows you to log and display the progress of an upload. The progress indicator automatically generates a unique progress ID number for each upload. NextProgressId returns the next unused progress ID.

Parameter

NextProgressId an SATransferStage, which specifies the stage of the upload: client-to-Web-server or Web-server-to-file-server.

SATransferStage Values
saClient0
saWebServer1
Example
[VBScript]
Set oFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
oFileUpEE.TransferStage = saWebServer
'--- Enable progress indication for client-to-Web-server
'--- and Web-server-to-file-server.
oFileUpEE.ProgressIndicator(saClient) = True
oFileUpEE.ProgressIndicator(saWebServer) = True
'--- Set the progress IDs for both upload stages to 
'--- each stage's next unused progress ID.
oFileUpEE.ProgressID(saClient) = oFileUpEE.NextProgressID
oFileUpEE.ProgressID(saWebServer) = oFileUpEE.NextProgressID
...
Top
ProcessRequest
Syntax
saResult = objFileUpEE.ProcessRequest(Request, [SoapRequest], [AutoProcess])
Description

ProcessRequest passes the Request object (as an IStream) to FileUpEE. The collection of transferred files is not available until after ProcessRequest is called.

Parameters
Request The Request object.
SoapRequest

When set to true, FileUpEE will process the file transfer as a SOAP transfer. Set SoapRequest to true when transferring files from server to server, for example, when transferring files from your web server to a file server.

When set to false, FileUpEE will process the file transfer as a form-based file upload. Set SoapRequest to false when uploading files from client to server.

Default value: false
AutoProcess

If AutoProcess is set to true, FileUpEE will process the request according to the SOAP payload (the XML document tranferred with a SOAP request), and processing instructions (such as a Save statement) are not required in the script that contains the ProcessRequest statement.

When AutoProcess is set to true, the SOAP payload must contain all necessary information to process the Request. For example, when uploading from a web server to a file server, if AutoProcess is set to true in the file server script, the web server script must contain all file server instructions. The instructions will be executed automatically on the file server.

If AutoProcess is set to false, FileUpEE will process the request according to your script. In this case, include all processing instructions (such as database information) in your script.

Default value: false
Return Value

ProcessRequest returns an saResult:

saResult Values
saAllProcessed0All files were processed without error.
Note
saResult values specify whether or not files were processed correctly, not whether they were saved. If, for example, an uploaded file is not saved because FileEE.OverwriteFile is disabled, the file was processed without error.
saSomeProcessed1Errors occurred when processing one or more files. Some files were processed without error.
saNoneProcessed2Errors occurred when processing all files.
saNetworkError3A network error stopped the upload before it was complete.
saMaxUpload4The upload size was greater than MaxKBytesToCancel. The upload stopped at that value.
saFileNotFound5
saSendError6Generic server error.
saGeneralError7
Examples

To process an upload from an HTML form, use:

objFileUpEE.ProcessRequest Request, False, False

To process a SOAP file transfer from a web server to a file server according to the SOAP payload, use:

objFileUpEE.ProcessRequest Request, True, True
Top
ResetAllProgressIds
Syntax
objFileUpEE.ResetAllProgressIds(SATransferStage)
Description

FileUpEE's server-side progress indicator allows you to log and display the progress of an upload. For each upload that it monitors, the progress indicator generates a unique progress ID number. ResetAllProgressIds resets all FileUpEE progress IDs, clearing the progress indicator of data from all previous and current uploads.

Parameter

ResetAllProgressIds takes an SATransferStage, which specifies the stage of the upload: client to web server or web server to file server.

SATransferStage Values
saClient0
saWebServer1
Example
[VBScript]
Set oFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
oFileUpEE.TransferStage = saWebServer
'--- Enable progress indication for client-to-Web-server
'--- and Web-server-to-file-server.
oFileUpEE.ProgressIndicator(saClient) = True
oFileUpEE.ProgressIndicator(saWebServer) = True
'--- Reset all progress IDs for both upload stages.
oFileUpEE.ResetAllProgressID(saClient)
oFileUpEE.ResetAllProgressID(saWebServer)
'--- Set the progress IDs for both upload stages.
oFileUpEE.ProgressID(saClient) = oFileUpEE.NextProgressID
oFileUpEE.ProgressID(saWebServer) = oFileUpEE.NextProgressID
...
Top
ResetProgressId
Syntax
objFileUpEE.ResetProgressId(SATransferStage) ProgressId as Long
Description

FileUpEE's server-side progress indicator allows you to log and display the progress of an upload. For each upload that it monitors, the progress indicator generates a unique progress ID number. ResetProgressId resets a specified progress ID, and ensures that the progress indicator will not store data from previous complete or interrupted uploads.

Parameter

ResetProgressId takes two parameters: SATransferStage, and ProgressId. SATransferStage specifies the stage of the upload: client -> web server or web server -> file server.

SATransferStage Values
saClient0
saWebServer1
Example
[VBScript]
Set oFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
oFileUpEE.TransferStage = saWebServer
'--- Enable progress indication for client-to-Web-server
'--- and Web-server-to-file-server.
oFileUpEE.ProgressIndicator(saClient) = True
oFileUpEE.ProgressIndicator(saWebServer) = True
'--- Set the progress IDs for both upload stages.
oFileUpEE.ProgressID(saClient) = oFileUpEE.NextProgressID
oFileUpEE.ProgressID(saWebServer) = oFileUpEE.NextProgressID
'--- Reset the progress IDs for both upload stages.
oFileUpEE.ResetProgressID(saClient) oFileUpEE.ProgressID
oFileUpEE.ResetProgressID(saWebServer) oFileUpEE.ProgressID
...
Top
Resume
Syntax
objFileUpEE.Resume(JobId)
Description

Resumes an upload that was suspended because of a network connection failure, or because the upload size was greater than MaxKBytesToCancel. Resume works at the request level, not the file level; if there are several files in an upload, you cannot call Resume for a specific file.

Parameter

Resume takes an upload's JobId and uses it to get the suspended upload's status from an upload status database. Resume then continues the upload from the point at which it stopped.

Set StatusUrl before calling Resume.

Return Value

Resume returns an saResult:

saResult Values
saAllProcessed0All files were processed without error.
Note
saResult values specify whether or not files were processed correctly, not whether they were saved. If, for example, an uploaded file is not saved because FileEE.OverwriteFile is disabled, the file was processed without error.
saSomeProcessed1Errors occurred when processing one or more files. Some files were processed without error.
saNoneProcessed2Errors occurred when processing all files.
saNetworkError3A network error stopped the upload before it was complete.
saMaxUpload4The upload size was greater than MaxKBytesToCancel. The upload stopped at that value.
saFileNotFound5
saSendError6Generic server error.
saGeneralError7
Example

In a standard 3-tier upload (client to web server to file server), there are three scripts: the client-side file submission script, the web server script, and the file server script. A resumable upload has two additional scripts: a resume-upload script and a status server script.

If the upload from web server to file server is suspended, and the user clicks a Resume link/button, the resume-upload script will be called. When the Resume method (within the resume-upload script) is called, a request will be made to the status server script. The response will tell FileUpEE the point at which the upload was suspended.

The following lines from the web server script create a link to the resume-upload script (send.asp). The query string includes the JobId which the Resume method will need to get the status of the suspended upload.

[VBScript]
...
On error resume next
numRetVal = objFileUpEE.SendRequest()
'--- If the upload from web server to file server
'--- is suspended because of a network error, display 
'--- a "Resume upload" link to send.asp.
If err.number <> 0 then
	Response.Write "<h2>Upload Failed</h2><br>"
	Response.Write objFileUpEE.Error 	
	Response.write "<br><a href=send.asp?JobId=" & objFileUpEE.JobId &_ 
			">Resume upload</a>"
	Response.End
End if
...	

In the resume-upload script (send.asp), Resume takes the upload's JobId and makes a request to the status server which returns the number of bytes received on the file server. Resume then continues the upload from the point at which it stopped.


...
'--- The Resume method takes the JobId sent from ws.asp
'--- and resumes the upload from the point at which it 
'--- stopped.
objFileUpEE.Resume(Request.QueryString("JobID"))
...
Top
ReturnStatus
Syntax
objFileUpEE.ReturnStatus(Request, Response)
Description

In a resumable upload, FileUpEE generates a unique JobId for each upload (not for each file). If the upload is suspended, the upload's JobId and information about the incomplete upload will be stored in an upload status database. You can then call Resume to resume the upload.

When Resume is called, FileUpEE makes a request to the StatusUrl to get status of the suspended upload. In the StatusUrl page, after getting the data from the upload status database, call ReturnStatus which will send a response to the Resume method. The response will tell FileUpEE the point at which the upload was suspended.

Example

In a standard 3-tier upload (client to web server to file server), there are three scripts: the client-side file submission script, the web server script, and the file server script. A resumable upload has two additional scripts: a resume-upload script and a status server script.

If the upload from web server to file server is suspended, and the user clicks a Resume link/button, the resume-upload script will be called. When the Resume method (within the resume-upload script) is called, a request will be made to the StatusUrl page. The response will tell FileUpEE the point at which the upload was suspended.

The following lines are from the StatusUrl page of a resumable upload application.

[VBScript]
'--- Set the connection string for the file server's 
'--- upload status database. If the upload to the file 
'--- server stops before all the data is transferred, 
'--- FileUpEE will enter upload status information in 
'--- this database.  To resume the upload, FileUpEE 
'--- reads the status of the suspended upload from this 
'--- database.
objFileUpEE.ResumeConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
		"Data Source=" & Server.MapPath(Application("vroot") & _ 
		"FileUpEEFS.mdb") & ";Persist Security Info=False"		
'--- Return the suspended upload's status to the Resume call.
objFileUpEE.ReturnStatus Request, Response
Top
SendRequest
Syntax
objFileUpEE.SendRequest([Response])
Description

SendRequest sends the HTTP file transfer request to the server, and returns an saResult:

saResult Values
saAllProcessed0All files were processed without error.
Note
saResult values specify whether or not files were processed correctly, not whether they were saved. If, for example, an uploaded file is not saved because FileEE.OverwriteFile is disabled, the file was processed without error.
saSomeProcessed1Errors occurred when processing one or more files. Some files were processed without error.
saNoneProcessed2Errors occurred when processing all files.
saNetworkError3A network error stopped the upload before it was complete.
saMaxUpload4The upload size was greater than MaxKBytesToCancel. The upload stopped at that value.
saSendError5Generic server error.
Parameter
Response Optional. When downloading files from a file server to a web server to a browser, pass the file server Response to SendRequest. That is, send the file server Response from the web server to the client.

Passing in this optional parameter will result in data being streamed from the file server to the client through the web server without being cached entirely on the web server.

Upload Example
[VBScript]
Set objFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
objFileUpEE.ProcessRequest Request
...
objFileUpEE(0).DestinationPath = "C:\temp\" & objFileUpEE(0).ClientFileName
...
objFileUpEE.TargetUrl = "http://localhost/fileupeescripts/fs.asp"
...
objFileUpEE.SendRequest()
Download Example
[VBScript]
Set objFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
...	
objFileUpEE.AddDownloadFile "c:\reports\april.xls", "c:\downloads\april.xls"
objFileUpEE.TargetUrl = "http://localhost/fileupeedownload/fsDown.asp"
objFileUpEE.SendRequest(Response)
...
Top
SendResponse
Syntax
objFileUpEE.SendResponse Response
Description

SendResponse takes the response object (as an IStream) and sends the response from the file server to the web server.

Example
[VBScript]
'--- The following is a file server script for an upload from browser to 
'--- web server to file server. Note that AutoProcess is set to 
'--- True, so FileUpEE will process the Request according to the SOAP 
'--- payload, and processing instructions (such as a Save statement) are not 
'--- required in script.
Set objFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
objFileUpEE.ProcessRequest Request, True, True
objFileUpEE.SendResponse Response
Response.End
Top
TransferFile
Syntax
objFileUpEE.TransferFile(Request,Response,FileName,[URL])
Description

TransferFile downloads a file from file server to web server to client, or from web server to client.

In a web server to client download, do not set the URL parameter. Set the content-type response header in the web server page.

In a file server to web server to client download, in the file server page, set the URL parameter to the web server page that will download the file. Set the content-type response header in the file server page.

The TransferFile method does not set response headers for the download. To let the browser know how to handle a download, set the content-type and content-disposition response headers:

Response.ContentType = "application/msword"
Response.AddHeader "content-disposition", "attachment;filename=""docdownload.doc"""
Parameters
RequestThe Request object.
ResponseThe Response object.
FileNameThe path and name of the file to download.
[URL]Optional. In a file server to web server to client download, in the file server page, set the URL parameter to the web server page that will download the file.
Examples:

When downloading from file server to web server to client, call TransferFile on the file server. The fourth parameter should specify the URL of the script on the web server that will receive the download from the file server and send it to the client:

[VBScript]
'--- From the file server page in a 3-tier download.
objFileUpEE.TransferFile Request, Response, "C:\Images\image.gif",_
		"http://WebServer/download.asp"

When downloading from web server to client, do not pass TransferFile the URL parameter:

strPathToDownloadFile = Server.MapPath("/FileUpEE/Samples/sample.doc")
oFileUpEE.TransferFile Request, Response, strPathToDownloadFile
Top
ValidateChecksums
Syntax

objFileUpEE.ValidateChecksums

Description

Use ValidateChecksums to verify the integrity of data transferred from web server to file server. If UseChecksum is set to True on the web server, FileUpEE will generate a file content checksum for the upload and send the checksum with the upload. On the file server, use ValidateChecksums to verify that the data was not corrupted during transfer.

If the upload content checksum received from the web server and the checksum generated on the file server are identical, ValidateChecksums returns True. If the checksums are not identical, the upload was corrupted during transfer, and ValidateChecksums returns False.

Example

The following is from the file server script in a client to web server to file server upload.

bRetVal = objFileUpEE.ValidateChecksums()
If bRetVal = False then
	objFileUpEE.Error = "Checksum validation failed"
End if
	
See Also

You can generate and validate a content checksum for a single file or for the whole upload. For information on using per-file checksums, see FileEE.Checksum, FileEE.PreviousChecksum, FileEE.UseChecksum, and FileEE.ValidateChecksum.

Top
Object Model FileUpEE Object
FileCollection Object FileEE Object Progress Object


Copyright © 2005, SoftArtisans, Inc.