The FileUpEe Object

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


FileUpEe in ASP.NET

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 using (in C#) or Import (in VB.NET) directive to import the namespace to the ASP.NET page. This allows you to reference objects by name alone, without the namespace prefix. Add a reference to FileUpEE in ASP.NET by including this statement at the top of your code behind page:

In C#:      using SoftArtisans.Net;
In VB.NET:  Imports 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()
    

A new constructor which receives a boolean PreserveResumeInformation parameter has been added to FileUpEE for use with resumable uploads in ASP.NET. Passing in true will force FileUpEE to preserve resume information until the upload transfer is deemed successful. The default preserve behavior is to preserve resume information until the saSaveResult for each uploaded file returns saSaved or saExists. A new FileUpEE property, PreserveResumeInfo, can override this behavior.

In C#:      FileUpEe oFileUpEe = new FileUpEe(true);
In VB.NET:  Dim oFileUpEe as New FileUpEe(true)
    

FileUpEe in ASP

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

[VBScript] 
Set objFileUpEe = Server.CreateObject("SoftArtisans.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 FileUpCompat ResolveTimeout AddDownloadFile
CodePage FilterOn Resumable AddFile
ConnectTimeout Form ResumeConnectionString CreateDatabase
ContentDisposition HostPort SaveMethod Dispose
ContentType HttpResponse SendTimeout NextProgressId
CopyFiles Item StatusUrl ProcessRequest
DbConnection JobId StreamRequest ResetAllProgressIds
DbPrimaryKey MaxKBytes TargetUrl ResetProgressId
DbPrimaryKeyValue MaxKBytesToCancel TempStorageLocation Resume
DbSqlCommand OverwriteFiles TransferEncoding ReturnStatus
DbTableName PerConnectionBandwidthLimit TransferStage SendRequest
Description PerServerBandwidthLimit UseChecksum SendResponse
DestinationDirectory ProgressId UseMemory TransferBlob
DynamicAdjustScriptTimeout   ProgressIndicator TransferFile
Error PreserveMacBinary ValidateChecksums
ErrorLogDatabase PreserveResumeInfo
ErrorLogDestination
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 located in the samples at doc-samples\Samples\UploadSamples\Intermediate\Resume\ASP. You can generate a new audit log database in ASP with the FileUpEE.CreateDatabase method. To see the audit log, open the table FileUpEE. The State column contains an SAUploadState value.

SAUploadState Values
saTransferComplete 0
saTransferConnecting 1
saTransferTransferring 2
saTransferSuspended 3
saTransferError 4
saTransferCancelled 5
saTransferIncomplete 6
saTransferNotStarted 7

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\samples.

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
saWebServer 1
saFileServer 2
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.

AuditLogDatabase must be set before calling the ProcessRequest method.

See Also
Example
In ASP.NET:
[C#]
oFileUpEE.set_AuditLogDestination(saTransferStage.saWebServer, saLogDestination.saLogDatabase);
oFileUpEE.set_AuditLogDatabase(saTransferStage.saWebServer, "Provider=Microsoft.Jet.OLEDB.4.0;" +  
    "Data Source=C:\FileUpEE\FileUpEEWS.mdb;" +
    "Persist Security Info=False");

[VB.NET]
oFileUpEE.AuditLogDestination(saTransferStage.saWebServer) = saLogDestination.saLogDatabase 
oFileUpEE.AuditLogDatabase(saTransferStage.saWebServer) = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ 
    "Data Source=C:\FileUpEE\FileUpEEWS.mdb;" & _
    "Persist Security Info=False"
In ASP:
[VBScript]
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
saNoLog 0 (Default value) FileUpEE will not create an Audit log.
saLogFile 1 The audit log will be a file set by the property AuditLogFile.
saLogDatabase 2 FileUpEE will save log records in a database set by the property AuditLogDatabase.
saEventLog 4 File transfers will be logged in the Windows EventLog. To view the log go to Start/Control Panel/Administrative Tools/Event Viewer.
saDebugString 8 File 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
saWebServer 1
saFileServer 2
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.

AuditLogDestination must be set before calling the ProcessRequest method.

See Also
Example
In ASP.NET:
[C#]
oFileUpEE.set_AuditLogDestination(saTransferStage.saWebServer, saLogDestination.saLogFile);
oFileUpEE.set_AuditLogFile(saTransferStage.saWebServer, "D:\FileUpEE\auditlog.txt");

[VB.NET]
oFileUpEE.AuditLogDestination(saTransferStage.saWebServer) = saLogDestination.saLogFile
oFileUpEE.AuditLogFile(saTransferStage.saWebServer) = "D:\FileUpEE\auditlog.txt"
In ASP:
[VBScript]
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
saWebServer 1
saFileServer 2
See Also
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.

AuditLogFile must be set before calling the ProcessRequest method.

Example
In ASP.NET:
[C#]
oFileUpEE.set_AuditLogDestination(saTransferStage.saWebServer, saLogDestination.saLogFile);
oFileUpEE.set_AuditLogFile(saTransferStage.saWebServer, "D:\FileUpEE\auditlog.txt");

[VB.NET]
oFileUpEE.AuditLogDestination(saTransferStage.saWebServer) = saLogDestination.saLogFile
oFileUpEE.AuditLogFile(saTransferStage.saWebServer) = "D:\FileUpEE\auditlog.txt"
In ASP:
[VBScript]
oFileUpEE.AuditLogDestination(saWebServer) = saLogFile 
oFileUpEE.AuditLogFile(saWebServer) = "D:\FileUpEE\auditlog.txt"
Top
CodePage
Syntax
objFileUpEE.CodePage [= Language Code as Long]
Description

Sets or returns the language of the file(s) or folder(s) being transferred. SoftArtisans FileUpEE is Unicode compliant, enabling the transfer of data between systems regardless of language without the risk of data corruption. By setting FileUpEE's Codepage property you will be able to preserve file names in their original language.

FileUpEE's Codepage property specifies a Unicode language code for correctly storing the file name internally.

ASP.NET has end-to-end unicode support. To display the filename correctly in ASP, set the HTML <META> tag's Charset attribute as well as the Codepage property of the page directive.

When client and server share the same language platform, you do not need to set Codepage. For heterogeneous language support, use Codepage 65001 and charset UTF-8 (Unicode).

For a complete list of Codepage values, see Microsoft's Character Set Recognition reference.

Example
In ASP.NET:
[C#]
objFileUpEE.CodePage = 65001;

[VB.NET]                
objFileUpEE.CodePage = 65001
In ASP:
<%@ Language=VBScript codepage=65001 %> 
<% Option Explicit %>
<HTML>
    <HEAD> 
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    </HEAD>
    ... 
    <% 
    objFileUpEE.CodePage=65001 
    ... 
    %>
</HTML>


Note on the use of XFileEE as the client:
When using XFileEE as the client, you must also remember to set the CodePage property of the XFRequest object.

Top
ConnectTimeout (3-tier transfers only)
Syntax
objFileUpEE.ConnectTimeout [= Timeout in Seconds as Long]
Description

ConnectTimeout sets a timeout value in seconds for web server connection requests to the file server. 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
In ASP.NET:
[C#]
objFileUpEE.ConnectTimeout = 60;

[VB.NET]
objFileUpEE.ConnectTimeout = 60
In ASP:
[vbscript]
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.

Example
In ASP.NET:
[C#]
oFileUpEE.ContentType = "text/plain";

[VB.NET]
oFileUpEE.ContentType = "text/plain"
In ASP:
[vbscript]
oFileUpEE.ContentType = "text/plain"
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
In ASP.NET:
[C#]
FileUpEE oFileUpEE = new FileUpEE();
oFileUpEE.TransferStage = saTransferStage.saWebServer;
oFileUpEE.set_CopyFiles(saTransferStage.saWebServer, true);
...

[VB.NET]
Dim oFileUpEE As New FileUpEE()
oFileUpEE.TransferStage = saTransferStage.saWebServer
oFileUpEE.CopyFiles(saTransferStage.saWebServer) = True 
...
In ASP:
[VBScript]
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
In ASP.NET:
[C#]
objFileUpEE.DbConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" +
    @"Data Source=C:\Uploads\Images.mdb;" +
    "Persist Security Info=False";

[VB.NET]
objFileUpEE.DbConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=C:\Uploads\Images.mdb;" & _ 
    "Persist Security Info=False"
In ASP:
      
[VBScript]
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
In ASP.NET:
[C#]
... 
objFileUpEE.DbTableName = "Files";
objFileUpEE.DbSqlCommand = "Select * from Files where FileId = 184";
objFileUpEE.DbPrimaryKey = "FileId";
objFileUpEE.DbPrimaryKeyValue = "6325";
...

[VB.NET]
... 
objFileUpEE.DbTableName = "Files" 
objFileUpEE.DbSqlCommand = "Select * from Files where FileId = 184" 
objFileUpEE.DbPrimaryKey = "FileId" 
objFileUpEE.DbPrimaryKeyValue = "6325" 
...
In ASP:
[VBScript]
... 
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
In ASP.NET:
[C#]
... 
objFileUpEE.DbTableName = "Files";
objFileUpEE.DbSqlCommand = "Select * from Files where FileId = 184";
objFileUpEE.DbPrimaryKey = "FileId";
objFileUpEE.DbPrimaryKeyValue = "6235";
...

[VB.NET]
... 
objFileUpEE.DbTableName = "Files" 
objFileUpEE.DbSqlCommand = "Select * from Files where FileId = 184" 
objFileUpEE.DbPrimaryKey = "FileId" 
objFileUpEE.DbPrimaryKeyValue = "6235" 
...
In ASP:
[VBScript]
... 
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
In ASP.NET:
[C#]
...
objFileUpEE.DbTableName = "Files";
objFileUpEE.DbSqlCommand = "Select * from Files where FileId = 184";
objFileUpEE.DbPrimaryKey = "FileId";
objFileUpEE.DbPrimaryKeyValue = "6325";
...

[VB.NET]
...
objFileUpEE.DbTableName = "Files"
objFileUpEE.DbSqlCommand = "Select * from Files where FileId = 184" 
objFileUpEE.DbPrimaryKey = "FileId" 
objFileUpEE.DbPrimaryKeyValue = "6325" 
...
In ASP:
[VBScript]
...
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
In ASP.NET:
[C#]
...
objFileUpEE.SaveMethod = saSaveMethod.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[0].ClientFileName;
objFileUpEE[0].DbSchema.Add("File Name", dbFileName);
objFileUpEE[0].DbSchema.Add("ContentId", fileUp[0].ContentId);
... 

[VB.NET]
...
objFileUpEE.SaveMethod = saSaveMethod.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(0).ClientFileName
objFileUpEE(0).DbSchema.Add("File Name", dbFileName)
objFileUpEE(0).DbSchema.Add("ContentId", fileUp(0).ContentId)
... 
In ASP:
      
[VBScript]
...
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 metadata with the file transfer request. Description is a Read/Write property.

Example
In ASP.NET:
[C#]
FileUpEE oFileUpEE = new FileUpEE();
oFileUpEE.TransferStage = saTransferStage.saWebServer;
oFileUpEE.Description = "2-tier upload"; 
oFileUpEE.DestinationDirectory = Server.MapPath(@"/FileUpEE/samples/temp");
FileEE oFileEE = oFileUpEE.Files("myFile");
oFileEE.Save();
...

[VB.NET]
Dim oFileUpEE As New FileUpEE() 
oFileUpEE.TransferStage = saTransferStage.saWebServer 
oFileUpEE.Description = "2-tier upload" 
oFileUpEE.DestinationDirectory = Server.MapPath("/FileUpEE/samples/temp") 
Dim oFile As FileEE = oFileUpEE.Files("myFile")
oFile.Save()
...
In ASP:
[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
In ASP.NET:
[C#]
objFileUpEE.DestinationDirectory = @"C:\Uploads\Images\";
objFileUpEE[0].DestinationFileName = "image1.jpg";
objFileUpEE[1].DestinationFileName = "image2.jpg";
objFileUpEE[2].DestinationFileName = "image3.jpg";

[VB.NET]
objFileUpEE.DestinationDirectory = "C:\Uploads\Images\" 
objFileUpEE(0).DestinationFileName = "image1.jpg" 
objFileUpEE(1).DestinationFileName = "image2.jpg" 
objFileUpEE(2).DestinationFileName = "image3.jpg"
In ASP:
[VBScript]
objFileUpEE.DestinationDirectory = "C:\Uploads\Images\" 
objFileUpEE(1).DestinationFileName = "image1.jpg" 
objFileUpEE(2).DestinationFileName = "image2.jpg" 
objFileUpEE(3).DestinationFileName = "image3.jpg"
Top
DynamicAdjustScriptTimeout (ASP only)
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

In ASP.NET, you can only enable DynamicAdjustScriptTimeout in the application's web.config file. In ASP, however, you can either enable DynamicAdjustScriptTimeout in code or in the or 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.
Example
[VBScript]
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
In ASP.NET:
[C#]
Response.Write(objFileUpEE.Error);

[VB.NET]
Response.Write(objFileUpEE.Error)
In ASP:
[VBScript]
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 error logging on the web server and FileUpEEFs.mdb for error logging on the file server. Both databases are in FileUpEE\samples\UploadSamples\Intermediate\Resume\ASP. You can generate a new error log database in ASP 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
saWebServer 1
saFileServer 2
See Also
Note

ErrorLogDatabase must be set before calling the ProcessRequest method.

Example
In ASP.NET:
[C#]
objFileUpEE.set_ErrorLogDestination(saTransferStage.saWebServer, saLogDestination.saLogDatabase);
objFileUpEE.set_ErrorLogDatabase(saTransferStage.saWebServer, "Provider=Microsoft.Jet.OLEDB.4.0;" +
    "Data Source=C:\FileUpEE\FileUpEEWS.mdb;" +
    "Persist Security Info=False");
    
[VB.NET]
objFileUpEE.ErrorLogDestination(saTransferStage.saWebServer) = saLogDestination.saLogDatabase
objFileUpEE.ErrorLogDatabase(saTransferStage.saWebServer) = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ 
    @"Data Source=C:\FileUpEE\FileUpEEWS.mdb;" & _ 
    "Persist Security Info=False"
In ASP:
[VBScript]
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
saNoLog 0 (Default value) FileUpEE will not create an Error log.
saLogFile 1 Errors will be logged in the file set by the property ErrorLogFile.
saLogDatabase 2 Errors will be logged in a database set by the property ErrorLogDatabase.
saEventLog 4 Errors will be logged in the Windows EventLog. To view the errors go to Start/Control Panel/Administrative Tools/Event Viewer.
saDebugString 8 Errors 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
saWebServer 1
saFileServer 2
See Also
Note

ErrorLogDestination must be set before calling the ProcessRequest method.

Example
In ASP.NET:
[C#]
objFileUpEE.set_ErrorLogDestination(saTransferStage.saWebServer, saLogDestination.saLogDatabase);
objFileUpEE.set_ErrorLogDatabase(saTransferStage.saWebServer, "Provider=Microsoft.Jet.OLEDB.4.0;" + 
    @"Data Source=C:\FileUpEE\FileUpEEWS.mdb;" +
    "Persist Security Info=False");

[VB.NET]
objFileUpEE.ErrorLogDestination(saTransferStage.saWebServer) = saLogDestination.saLogDatabase 
objFileUpEE.ErrorLogDatabase(saTransferStage.saWebServer) = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ 
    "Data Source=C:\FileUpEE\FileUpEEWS.mdb;" & _ 
    "Persist Security Info=False"
In ASP:
          
[VBScript]
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
saWebServer 1
saFileServer 2
See Also
AuditLogDatabase, AuditLogDestination, AuditLogFile, ErrorLogDatabase, and ErrorLogDestination.

ErrorLogFile must be set before calling the ProcessRequest method.

Example
In ASP.NET:
[C#]
objFileUpEE.set_ErrorLogDestination(saTransferStage.saWebServer, saLogDestination.saLogFile);
objFileUpEE.set_ErrorLogFile(saTransferStage.saWebServer, "C:\FileUpEE\ErrorLog.txt");

[VB.NET]
objFileUpEE.ErrorLogDestination(saTransferStage.saWebServer) = saLogDestination.saLogFile 
objFileUpEE.ErrorLogFile(saTransferStage.saWebServer) = @"C:\FileUpEE\ErrorLog.txt"
In ASP:
[VBScript]
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
In ASP.NET:
[C#]
FileUpEE objFileUpEE = new FileUpEE();
FileEE FirstFile = objFileUpEE.Files[0]; 
FirstFile.OverwriteFile = false;
FirstFile.DestinationPath = @"C:\Uploads\Images\file.gif";
...

[VB.NET]
Dim objFileUpEE As New FileUpEE()
Dim FirstFile As FileEE = objFileUpEE.Files(0)
FirstFile.OverwriteFile = False 
FirstFile.DestinationPath = "C:\Uploads\Images\file.gif" 
...
In ASP:
          
[VBScript] 
Set objFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
Set FirstFile = objFileUpEE.Files(0) 
FirstFile.OverwriteFile = False 
FirstFile.DestinationPath = "C:\Uploads\Images\file.gif" 
...
Top
FileUpCompat (ASP Only)
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
FilterOn
Syntax
objFileUpEE.FilterOn(SATransferStage) [= Boolean]
Description

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

FilterOn is a Read Only property.

Example
In ASP.NET:
[C#]
FileUpEE oFileUpEE = new FileUpEE(); 
oFileUpEE.TransferStage = saTransferStage.saWebServer;
oFileUpEE.DestinationDirectory = Server.MapPath(@"/FileUpEE/samples/temp");
FileEE oFile = oFileUpEE.Files["myFile"];
oFile.Save();
if (oFile.Processed == saSaveResult.saSaved)
{
    Response.Write(@"<h3>Upload Successful</h3>");
    Response.Write("DestinationPath: " + oFile.DestinationPath);
    Response.Write("<br>");
    Response.Write("FilterOn: " + oFileUpEE.get_FilterOn(saTransferStage.saWebServer));
...

[VB.NET]
Dim oFileUpEE As New FileUpEE() 
oFileUpEE.TransferStage = saTransferStage.saWebServer 
oFileUpEE.DestinationDirectory = Server.MapPath("/FileUpEE/samples/temp")
Dim oFile as FileEE = oFileUpEE.Files("myFile") 
oFile.Save()
If oFile.Processed = saSaveResult.saSaved Then
    Response.Write("<h3>Upload Successful</h3>")
    Response.Write("DestinationPath:" & oFile.DestinationPath)
    Response.Write("<br>")
    Response.Write("FilterOn:" & oFileUpEE.FilterOn(saTransferStage.saWebServer))
...
In ASP:
[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
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
Count Returns the number of form elements (excluding files) in an uploaded HTML form.
Exists Returns true if a specified form element exists, false if it does not.
Item Represents 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.NET

    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:

    [C#]
    foreach(SaDictionary objElem in fileUp.Form) 
    { 
        if(objElem.Value is String)
        { 
            Response.Write("Name:"); 
            Response.Write(objElem.Name); 
            Response.Write("Value:");
            Response.Write(objElem.Value);
        } 
        else 
        { 
            Response.Write("Name:"); 
            Response.Write(strName);
            Response.Write("Value:"); 
            Response.Write("<br>"); 
            Response.Write("Sub Array:"); 
            
            foreach(SaDictionary objSubElem in (IEnumerable)objElem.Value) 
            { 
                Response.Write("Name:");
                Response.Write(objSubElem.Name); 
                Response.Write("Value:"); 
                Response.Write(objSubElem.Value);
                Response.Write("<br>"); 
            } 
        } 
        Response.Write("<br>");
    }
    
    [VB.NET]
    For Each objElem As SaDictionary In fileUp.Form
        If objElem.Value Is String
            Response.Write("Name:")
            Response.Write(objElem.Name)
            Response.Write("Value:")
            Response.Write(objElem.Value)
        Else 
            Response.Write("Name:")
            Response.Write(strName)
            Response.Write("Value:")
            Response.Write("<br>")
            Response.Write("Sub Array:")
            
            For Each objSubElem As SaDictionary In DirectCast(objElem.Value, IEnumerable)
                Response.Write("Name:")
                Response.Write(objSubElem.Name)
                Response.Write("Value:")
                Response.Write(objSubElem.Value)
                Response.Write("<br>")
            Next 
        End If 
        Response.Write("<br>");
    Next
    
  • Checking in ASP

    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:

    [VBScript]
    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
                            
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
BodyText If the response from the next stage is not a SOAP response, you can use BodyText to get the HTTP response. Example:
oFileUpEE.HttpResponse.BodyText
Header Returns the value of a specified HTTP header. Example:
oFileUpEE.HttpResponse.Header("content-type")
Headers Returns all HTTP response headers. Example:
oFileUpEE.HttpResponse.Headers
Status Returns 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
In ASP.NET:
[C#]
//--- Save the first file in an upload to a directory 
objFileUpEE[0].SaveMethod = saSaveMethod.saDiskFile;
objFileUpEE[0].DestinationFileName = @"C:\Uploads\Images\image.jpg";
objFileUpEE[0].OverwriteFile = true;

[VB.NET]
'--- Save the first file in an upload to a directory 
objFileUpEE(0).SaveMethod = saSaveMethod.saDiskFile 
objFileUpEE(0).DestinationFileName = "C:\Uploads\Images\image.jpg"
objFileUpEE(0).OverwriteFile = True
In ASP:
[VBScript]
'--- 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 by the HttpModule in ASP.NET or in an upload status database in ASP. 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 HttpModule or 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. The query string includes the JobId which the Resume method will need to get the status of the suspended upload.

In ASP.NET:
[C#]
... 
saResult 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.aspx. 
if (err.number != 0)
{ 
    Response.Write(@"<h2>Upload Failed</h2><br>");
    Response.Write(objFileUpEE.Error);
    Response.Write("<br><a href=send.aspx?JobId=" + objFileUpEE.JobId + 
        @">Resume upload</a>"); 
    Response.End();
}
...

[VB.NET]
... 
On Error Resume Next 
Dim numRetVal As saResult = 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.aspx. 
If err.number <> 0 Then 
    Response.Write("<h2>Upload Failed</h2><br>")
    Response.Write(objFileUpEE.Error)
    Response.Write("<br><a href=send.aspx?JobId=" & objFileUpEE.JobId & _ 
        ">Resume upload</a>")
    Response.End()
End If 
...
In ASP:
[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 or send.aspx), 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.

In ASP.NET:
[C#]
... 
//--- The Resume method takes the JobId sent from ws.aspx
//--- and resumes the upload from the point at which it 
//--- stopped. 
objFileUpEE.Resume(Request.QueryString("JobID"));
...

[VB.NET]
... 
'--- The Resume method takes the JobId sent from ws.aspx
'--- and resumes the upload from the point at which it 
'--- stopped. 
objFileUpEE.Resume(Request.QueryString("JobID"))
...
In ASP:
[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 (ASP Only)
Syntax
objFileUpEE.MaxKBytes(SATransferStage) [= Upload size limit in Kilobytes as Double]
Description

Note: To set MaxKBytes in ASP.NET uploads, change the settings for the MaxKBytes application key in the web.config file.

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 and no error will be thrown if the MaxKBytes limit is exceeded.

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
saWebServer 1
saFileServer 2
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 (ASP Only)
Syntax
objFileUpEE.MaxKBytesToCancel(SATransferStage) [= File size limit in Kilobytes as Double]
Description

Note: To set MaxKBytesToCancel in ASP.NET uploads, change the settings for the MaxKBytesToCancel application key in the web.config file.

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 Denial of Service (DoS) attack on the file server. When an upload size hits MaxKBytesToCancel, the connection to the server will be terminated, the ASP page will finish executing, and the ASP 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
saWebServer 1
saFileServer 2
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
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
In ASP.NET:
[C#]
FileUpEE oFileUpEE = new FileUpEE();
 
//--- Set bandwidth limit to 10-KB per second 
oFileUpEE.PerConnectionBandwidthLimit = 10;

//--- Start the download 
oFileUpEE.TransferFile(Page.Context, @"C:\Images\image.gif");

[VB.NET]
Dim oFileUpEE As New FileUpEE()
 
'--- Set bandwidth limit to 10-KB per second 
oFileUpEE.PerConnectionBandwidthLimit = 10

'--- Start the download 
oFileUpEE.TransferFile(Page.Context, "C:\Images\image.gif")
In ASP:
[VBScript] 
Set oFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
 
'--- Set bandwidth limit to 10-KB per second 
oFileUpEE.PerConnectionBandwidthLimit = 10

'--- Start the download 
oFileUpEE.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
In ASP.NET:
[C#]
FileUpEE oFileUpEE = new FileUpEE();

//--- Set the server output bandwidth limit to 1000 KB per 
//--- second for all connections combined
oFileUpEE.PerServerBandwidthLimit = 1000;

//--- Start the download
oFileUpEE.TransferFile(Page.Context, @"C:\Images\image.gif");

[VB.NET]
Dim oFileUpEE As New FileUpEE()

'--- Set the server output bandwidth limit to 1000 KB per 
'--- second for all connections combined
oFileUpEE.PerServerBandwidthLimit = 1000 

'--- Start the download
oFileUpEE.TransferFile(Page.Context, "C:\Images\image.gif")
In ASP:
[VBScript]
Set oFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")

'--- Set the server output bandwidth limit to 1000 KB per 
'--- second for all connections combined
oFileUpEE.PerServerBandwidthLimit = 1000 

'--- Start the download
oFileUpEE.TransferFile Request, Response, "C:\Images\image.gif"
Top
PreserveMacBinary (ASP Only)
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.

Note: When using the HttpModule, this property will have no effect.
Example
[VBScript]
objFileUpEE.PreserveMacBinary = True
Top
PreserveResumeInfo (ASP.NET only)
Syntax
objFileUpEE.PreserveResumeInfo [= Resume Preserve Info as saPreserveBehavior]
Description

PreserveResumeInfo gives control over the deletion of resume information in FileUpEE during a resumable upload transfer in ASP.NET. To use this property, the FileUpEe object must be instantiated with the PreserveResumeInformation parameter set to true.

PreserveResumeInfo is a Read/Write property.

Passing true to the FileUpEE constructor automatically enables the default resume behavior of FileUpEE, which is to preserve resume information until the upload transfer is deemed successful. By default, FileUpEE assumes an upload has succeeded if the saSaveResult for each uploaded file in the Files collection returns saSaved or saExists.

Setting the PreserveResumeInfo property to saPreserveBehavior.saPreserve or saPreserveBehavior.saDelete overrides FileUpEE's default resume behavior, preserving or deleting the resume information when the FileUpEe object is destructed.

saPreserveBehavior Values
saDefault If the PreserveResumeInformation parameter was set to true in the constructor, FileUpEE will exhibit its default resume behavior - that is, FileUpEE will not delete the temporary resume and request files until it deems that the upload has succeeded. FileUpEE assumes an upload to be successful if the saSaveResult for each uploaded file in the Files collection returns saSaved or saExists.
saPreserve FileUpEE will not delete the temporary resume and request files. They will remain in the FileUpEeModule's cache location along with the tmp files - that is, the actual uploaded files that were cached - until the the upload is deemed successful and the PreserveResumeInfo is set to saDefault. If this property is not explicitly reset to saDefault at some point in the upload processing, the uploaded files will never be moved to the final save location.
saDelete FileUpEE will delete the temporary resume and request files whether the upload transfer succeeds or not.
Note
Example
[C#]
//--- You must pass the boolean value true into the FileUpEE
//--- constructor in order to enable PreserveResumeInformation
FileUpEE oFileUpEE = new FileUpEE(true);
...
if (oFile.Size != 0)
{
    try
    {
        //--- Save the file to the webserver disk
        oFile.Save();                          
    }
    catch(Exception ex)
    {
        //--- If there is a general exception, delete the temporary files
        oFileUpEE.PreserveResumeInfo = saPreserveBehavior.saDelete; 
        saveExceptionInfo.Append("<b>WebServer exception: </b>An + 
            error occurred when saving the file <i>" + oFile.ClientFileName + 
            "</i><br/><b>Exception: </b>" + ex.Message + "<br/><br/>");
    }
}

[VB.NET]
'--- You must pass the boolean value true into the FileUpEE
'--- constructor in order to enable PreserveResumeInformation
Dim oFileUpEE As New FileUpEE(true)
...
If oFile.Size <> 0 Then
    Try
        '--- Save the file to the webserver disk
        oFile.Save()
    Catch ex As Exception
        '--- If there is a general exception, delete the temporary files
        oFileUpEE.PreserveResumeInfo = saPreserveBehavior.saDelete
        saveExceptionInfo.Append("<b>WebServer exception: </b>An " & _
            error occurred when saving the file <i>" & oFile.ClientFileName & _ 
            "</i><br/><b>Exception: </b>" & ex.Message & "<br/><br/>")
End If
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
saClient 0 Upload to web server
saWebServer 1 Upload 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.

In ASP.NET:
[C#]
FileUpEE objFileUpEE = new FileUpEe();
objFileUpEE.TransferStage = saTransferStage.saWebServer;

//--- Enable the progress indicator for both stages of the upload. 
objFileUpEE.set_ProgressIndicator(saTransferStage.saClient, true);
objFileUpEE.set_ProgressIndicator(saTransferStage.saWebServer, true);

//--- Set the ProgressIds for each stage to the ProgressId values 
//--- sent in the QueryString. 
objFileUpEE.set_ProgressId(saTransferStage.saClient, Convert.ToInt32(Request.QueryString["progressid"]));
objFileUpEE.set_ProgressId(saTransferStage.saWebServer, Convert.ToInt32(Request.QueryString["WSprogressid"]));
...

[VB.NET]
Dim objFileUpEE As New FileUpEe()
objFileUpEE.TransferStage = saWebServer

'--- Enable the progress indicator for both stages of the upload. 
objFileUpEE.ProgressIndicator(saTransferStage.saClient) = True 
objFileUpEE.ProgressIndicator(saTransferStage.saWebServer) = True 

'--- Set the ProgressIds for each stage to the ProgressId values 
'--- sent in the QueryString. 
objFileUpEE.ProgressId(saTransferStage.saClient) = Convert.ToInt32(Request.QueryString("progressid"))
objFileUpEE.ProgressId(saTransferStage.saWebServer) = Convert.ToInt32(Request.QueryString("WSprogressid"))
...
In ASP:
[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.

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.

In ASP.NET:
[C#]
FileUpEE objFileUpEE = new FileUpEe();
objFileUpEE.TransferStage = saTransferStage.saWebServer; 

//--- Enable the progress indicator for both stages of the upload. 
objFileUpEE.set_ProgressIndicator(saTransferStage.saClient, true);
objFileUpEE.set_ProgressIndicator(saTransferStage.saWebServer, true);

//--- Set the ProgressIds for each stage to the ProgressId values 
//--- sent in the QueryString. 
objFileUpEE.set_ProgressId(saTransferStage.saClient, Convert.ToInt32(Page.Request.QueryString("progressid")));
objFileUpEE.set_ProgressId(saTransferStage.saWebServer, Convert.ToInt32(Page.Request.QueryString("WSprogressid")));
...

[VB.NET]
Dim objFileUpEE As New FileUpEe()
objFileUpEE.TransferStage = saTransferStage.saWebServer

'--- Enable the progress indicator for both stages of the upload. 
objFileUpEE.ProgressIndicator(saTransferStage.saClient) = True 
objFileUpEE.ProgressIndicator(saTransferStage.saWebServer) = True 

'--- Set the ProgressIds for each stage to the ProgressId values 
'--- sent in the QueryString. 
objFileUpEE.ProgressId(saTransferStage.saClient) = CInt(Page.Request.QueryString("progressid"))
objFileUpEE.ProgressId(saTransferStage.saWebServer) = CInt(Page.Request.QueryString("WSprogressid"))
...
In ASP:
[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
In ASP.NET:
[C#]
objFileUpEE.ReceiveTimeout = 60;

[VB.NET]
objFileUpEE.ReceiveTimeout = 60
In ASP:
[VBScript]
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
saWebServer 1
saFileServer 2
Example
In ASP.NET:
[C#]
objFileUpEE.set_RequestTimeout(saTransferStage.saWebServer, 60);

[VB.NET]
objFileUpEE.RequestTimeout(saTransferStage.saWebServer) = 60
In ASP:
[VBScript]
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
In ASP.NET:
[C#]
objFileUpEE.ResolveTimeout = 60;

[VB.NET]
objFileUpEE.ResolveTimeout = 60
In ASP:
[VBScript]
objFileUpEE.ResolveTimeout = 60
Top
Resumable (ASP Only)
Syntax
objFileUpEE.Resumable(SATransferStage) [= Boolean]
Description

Note: In ASP.NET, set resumability to true using the Resumable application key in the web.config file of the application's web server and/or file server.

When Resumable is set to true, FileUpEE will be able to resume an upload in ASP 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.

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
saWebServer 1
saFileServer 2
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 (ASP Only)
Syntax
objFileUpEE.ResumeConnectionString(SATransferStage) [= Connection String]
Description

Note: In ASP.NET, resume information is handled by the HttpModule and there is no upload status database.

In a resumable upload in ASP, 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 in ASP (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
saWebServer 1
saFileServer 2
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
saDatabase 0
saDiskFile 1 (Default value)
See Also
Example
In ASP.NET:
[C#]
... 
objFileUpEE.SaveMethod = saSaveMethod.saDatabase;
objFileUpEE.DbConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" +
    @"Data Source=C:\Uploads\files.mdb;" +
    "Persist Security Info=False";
objFileUpEE.DbTableName = "Images"; 
String dbFileName = objFileUpEE.ClientFileName;
objFileUpEE[0].DbSchema.Add("File Name", dbFileName);
...

[VB.NET]
... 
objFileUpEE.SaveMethod = saSaveMethod.saDatabase 
objFileUpEE.DbConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ 
    "Data Source=C:\Uploads\files.mdb;" & _ 
    "Persist Security Info=False" 
objFileUpEE.DbTableName = "Images" 
Dim dbFileName As String = objFileUpEE.ClientFileName 
objFileUpEE(0).DbSchema.Add("File Name", dbFileName)
...
In ASP:
[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
In ASP.NET:
[C#]
objFileUpEE.SendTimeout = 60;

[VB.NET]
objFileUpEE.SendTimeout = 60
In ASP:
[VBScript]
objFileUpEE.SendTimeout = 60
Top
StatusUrl (3-tier resumable transfers only)
Syntax
objFileUpEE.StatusUrl [=URL]
Description

In a standard 3-tier resumable 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.

In ASP.NET:
[C#]
//--- Set the status URL on the file server. If the 
//--- upload is suspended, and the user click's "Resume," 
//--- status.aspx 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.aspx";

[VB.NET]
'--- Set the status URL on the file server. If the 
'--- upload is suspended, and the user click's "Resume," 
'--- status.aspx 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.aspx";
In ASP:
[VBScript]
'--- 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 (ASP only)
Syntax
objFileUpEE.StreamRequest [= Boolean]
Description

Important Note: Streaming Uploads are only available in ASP, due to limitations in the .NET framework. Therefore, this property is only effective in an ASP environment.

In an ASP-based 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 you want to get information submitted from the client before setting TargetURL on the web server, 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.

Note

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
[VBScript]
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.

In ASP.NET:
[C#]
objFileUpEE.TargetUrl = "http://www.fileserver.com/fileserver.aspx";

[VB.NET]
objFileUpEE.TargetUrl = "http://www.fileserver.com/fileserver.aspx"
In ASP:
[VBScript]
objFileUpEE.TargetUrl = "http://www.fileserver.com/fileserver.asp"
Top
TempStorageLocation (ASP Only)
Syntax
objFileUpEE.TempStorageLocation(SATransferStage) [= Temp Directory]
Description

Note: In ASP.NET uploads, the temporary storage location is set using the HttpModule's FileUpEETempDir application key.

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:

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

TempStorageLocation is a Read/Write property.

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
saWebServer 1
saFileServer 2
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
saChunked 1
Example
In ASP.NET:
[C#]
FileUpEE oFileUpEE = new FileUpEE();
oFileUpEE.TransferStage = saTransferStage.saWebServer;
oFileUpEE.set_TransferEncoding(saTransferStage.saWebServer, saTransferEncoding.saChunked);
...

[VB.NET]
Dim oFileUpEE As New FileUpEE()
oFileUpEE.TransferStage = saTransferStage.saWebServer
oFileUpEE.TransferEncoding(saTransferStage.saWebServer) = saTransferEncoding.saChunked
...
In ASP:
[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
saWebServer 1
saFileServer 2

TransferStage is a Read/Write property.

Example

Set a script's TransferStage before calling ProcessRequest:

In ASP.NET:
[C#]
FileUpEE objFileUpEE = new FileUpEE();

//--- Set the upload's transfer stage to saWebServer. 
objFileUpEE.TransferStage = saTransferStage.saWebServer;
objFileUpEE.ProcessRequest(Page.Request, false, false);

[VB.NET]
Dim objFileUpEE As New FileUpEE()

'--- Set the upload's transfer stage to saWebServer. 
objFileUpEE.TransferStage = saTransferStage.saWebServer 
objFileUpEE.ProcessRequest(Page.Request, False, False)
In ASP:
[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 (ASP Only)
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
saWebServer 1
saFileServer 2
Note on UseMemory and the HttpModule Filters

FileUpEE's UseMemory property allows you to keep uploaded data in memory until it is saved. FileUpEE's HttpModule reads the whole upload request and writes it to temporary files before the request is processed by the ASP.NET page on the server. If you set UseMemory in the ASP.NET page, the property will have no effect because the page is processed after the filter writes the temp files.

Example
In ASP:
[VBScript]
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."

In ASP.NET:
[C#]
FileUpEE objFileUpEE = new FileUpEE();
objFileUpEE.ProcessRequest(Page.Request, false, false);
objFileUpEE.AddDbDownloadFile(fileUp.Form("Client"), "file1", false);
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.aspx";
objFileUpEE.SendRequest(Page.Response);

[VB.NET]
Dim objFileUpEE As New FileUpEE()
objFileUpEE.ProcessRequest(Page.Request, False, False)
objFileUpEE.AddDbDownloadFile(fileUp.Form("Client"), "file1", False)
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.aspx" 
objFileUpEE.SendRequest(Page.Response)
In ASP:
[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:

In ASP.NET:
[C#]
oFileUpEE[0].DownloadedPath = @"C:\images\image.jpg";
oFileUpEE[0].ClientFileName = oFileUpEE.Form("Client");

[VB.NET]
oFileUpEE(0).DownloadedPath = "C:\images\image.jpg" 
oFileUpEE(0).ClientFileName = oFileUpEE.Form("Client")
In ASP:
[VBScript]
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."

In ASP.NET:
[C#]
FileUpEE objFileUpEE = new FileUpEE();
objFileUpEE.ProcessRequest(Page.Request, false, false);
objFileUpEE.AddDownloadFile(objFileUpEE.Form("Download"), objFileUpEE.Form("Client"), "file1");
objFileUpEE.TargetUrl = @"http://localhost/fileupee/download/fsDown.aspx";
saResult enumRetVal = objFileUpEE.SendRequest(Response);

[VB.NET]
Dim objFileUpEE As New FileUpEE()
objFileUpEE.ProcessRequest(Page.Request, False, False)
objFileUpEE.AddDownloadFile(objFileUpEE.Form("Download"), objFileUpEE.Form("Client"), "file1")
objFileUpEE.TargetUrl = "http://localhost/fileupee/download/fsDown.aspx"
Dim enumRetVal As String = objFileUpEE.SendRequest(Response)
In ASP:
[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,
In ASP.NET:
[C#]
objFileUpEE.AddFile(@"C:\first.xls", "AddedFile", 1234);
objFileUpEE["AddedFile"].OverwriteFile = false;
objFileUpEE["AddedFile"].DestinationPath = @"C:\Images\file.gif";
...

[VB.NET]
objFileUpEE.AddFile("C:\first.xls", "AddedFile", 1234)
objFileUpEE("AddedFile").OverwriteFile = False
objFileUpEE("AddedFile").DestinationPath = "C:\Images\file.gif"
...
In ASP:
[VBScript]
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
In ASP.NET:
[C#]
FileUpEE objFileUpEE = new FileUpEE();
objFileUpEE.ProcessRequest(Page.Request, false, false);
objFileUpEE.AddFile("C:\first.xls", "AddedFile", 1234);
objFileUpEE["AddedFile"].OverwriteFile = false;
objFileUpEE["AddedFile"].DestinationPath = "C:\Images\file.gif";
...

[VB.NET]
Dim objFileUpEE As New FileUpEE
objFileUpEE.ProcessRequest(Page.Request, False, False)
objFileUpEE.AddFile("C:\first.xls", "AddedFile", 1234)
objFileUpEE("AddedFile").OverwriteFile = False 
objFileUpEE("AddedFile").DestinationPath = "C:\Images\file.gif" 
...
In ASP:
[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 (ASP only)
Syntax
objFileUpEE.CreateDatabase(DatabasePath as String)
Description

CreateDatabase creates a FileUpEE database at the location specified by DatabasePath. This method is only available in ASP. It is not available in ASP.NET.

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 and unmanaged objects.

Example
[C#]
finally
{
    if (oFileUpEE != null)
    {
        oFileUpEE.Dispose();
    }
    oFileUpEE = null;
}

[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
saClient 0
saWebServer 1
Example
In ASP.NET:
[C#]
FileUpEE oFileUpEE = new FileUpEE();
oFileUpEE.TransferStage = saTransferStage.saWebServer;

//--- Enable progress indication for client-to-Web-server 
//--- and Web-server-to-file-server. 
oFileUpEE.set_ProgressIndicator(saTransferStage.saClient, true);
oFileUpEE.set_ProgressIndicator(saTransferStage.saWebServer, true);

//--- Set the progress IDs for both upload stages to 
//--- each stage's next unused progress ID. 
oFileUpEE.set_ProgressID(saTransferStage.saClient, oFileUpEE.NextProgressID(saTransferStage.saClient));
oFileUpEE.set_ProgressID(saTransferStage.saWebServer, oFileUpEE.NextProgressID(saTransferStage.saWebServer));
...

[VB.NET]
Dim oFileUpEE As New FileUpEE() 
oFileUpEE.TransferStage = saTransferStage.saWebServer 

'--- Enable progress indication for client-to-Web-server 
'--- and Web-server-to-file-server. 
oFileUpEE.ProgressIndicator(saTransferStage.saClient) = True 
oFileUpEE.ProgressIndicator(saTransferStage.saWebServer) = True 

'--- Set the progress IDs for both upload stages to 
'--- each stage's next unused progress ID. 
oFileUpEE.ProgressID(saTransferStage.saClient) = oFileUpEE.NextProgressID(saTransferStage.saClient)
oFileUpEE.ProgressID(saTransferStage.saWebServer) = oFileUpEE.NextProgressID(saTransferStage.saWebServer)
...
In ASP:
[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 on the file server of a 3-tier transfer.

When set to false, FileUpEE will process the file transfer as a form-based file upload. Set SoapRequest to false on the web server of any transfer.

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. AutoProcess should always be set to false on the web server of any transfer.

Default value: false
Return Value

ProcessRequest returns an saResult:

saResult Values
saAllProcessed 0 All 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.
saUnknownError 1 An unknown error occurred.
saAccessDenied 2 Access was denied.
saMaxUpload 3 The upload size was greater than MaxKBytesToCancel. The upload stopped at that value.
saDiskFull 4 There disk is full.
saFileNotFound 5 The file could not be found.
saNetworkError 6 A network error stopped the upload before it was complete.
saSendError 7 Generic server error.
saDatabaseError 8 A database error occurred.
saFileError 9 Returned when the file containing resumability information cannot be opened.
saSomeProcessed 10 Errors occurred when processing one or more files. Some files were processed without error.
saNoneProcessed 11 Errors occurred when processing all files.
saResponseError 12 The error occured returning the response.
saNonSoapRequest 13 The request was not a SOAP request.
Examples

To process an upload from an HTML form, use:

In ASP.NET:
[C#]
objFileUpEE.ProcessRequest(Page.Request, false, false);

[VB.NET]
objFileUpEE.ProcessRequest(Page.Request, False, False)
In ASP:
[VBScript]
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:

In ASP.NET:
[C#]
objFileUpEE.ProcessRequest(Page.Request, true, true);

[VB.NET]
objFileUpEE.ProcessRequest(Page.Request, True, True)
In ASP:
[VBScript]
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
saClient 0
saWebServer 1
Example
In ASP.NET:
[C#]
FileUpEE oFileUpEE = new FileUpEE();
oFileUpEE.TransferStage = saTransferStage.saWebServer;

//--- Enable progress indication for client-to-Web-server 
//--- and Web-server-to-file-server. 
oFileUpEE.set_ProgressIndicator(saTransferStage.saClient, true);
oFileUpEE.set_ProgressIndicator(saTransferStage.saWebServer, true);

//--- Reset all progress IDs for both upload stages. 
oFileUpEE.ResetAllProgressID(saTransferStage.saClient);
oFileUpEE.ResetAllProgressID(saTransferStage.saWebServer);

//--- Set the progress IDs for both upload stages. 
oFileUpEE.set_ProgressID(saTransferStage.saClient, oFileUpEE.NextProgressID());
oFileUpEE.set_ProgressID(saTransferStage.saWebServer, oFileUpEE.NextProgressID());
...

[VB.NET]
Dim oFileUpEE As New FileUpEE() 
oFileUpEE.TransferStage = saTransferStage.saWebServer 

'--- Enable progress indication for client-to-Web-server 
'--- and Web-server-to-file-server. 
oFileUpEE.ProgressIndicator(saTransferStage.saClient) = True 
oFileUpEE.ProgressIndicator(saTransferStage.saWebServer) = True 

'--- Reset all progress IDs for both upload stages. 
oFileUpEE.ResetAllProgressID(saTransferStage.saClient)
oFileUpEE.ResetAllProgressID(saTransferStage.saWebServer) 

'--- Set the progress IDs for both upload stages. 
oFileUpEE.ProgressID(saTransferStage.saClient) = oFileUpEE.NextProgressID() 
oFileUpEE.ProgressID(saTransferStage.saWebServer) = oFileUpEE.NextProgressID() 
...
In ASP:
[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
saClient 0
saWebServer 1
Example
In ASP.NET:
[C#]
FileUpEE oFileUpEE = new FileUpEE();
oFileUpEE.TransferStage = saTransferStage.saWebServer;

//--- Enable progress indication for client-to-Web-server 
//--- and Web-server-to-file-server. 
oFileUpEE.set_ProgressIndicator(saTransferStage.saClient, true);
oFileUpEE.set_ProgressIndicator(saTransferStage.saWebServer, true);

//--- Set the progress IDs for both upload stages. 
oFileUpEE.ProgressID(saTransferStage.saClient) = oFileUpEE.NextProgressID();
oFileUpEE.ProgressID(saTransferStage.saWebServer) = oFileUpEE.NextProgressID();

//--- Reset the progress IDs for both upload stages. 
oFileUpEE.ResetProgressID(saTransferStage.saClient, oFileUpEE.ProgressID);
oFileUpEE.ResetProgressID(saTransferStage.saWebServer, oFileUpEE.ProgressID);
...

[VB.NET]
Dim oFileUpEE As New FileUpEE() 
oFileUpEE.TransferStage = saTransferStage.saWebServer 

'--- Enable progress indication for client-to-Web-server 
'--- and Web-server-to-file-server. 
oFileUpEE.ProgressIndicator(saTransferStage.saClient) = True 
oFileUpEE.ProgressIndicator(saTransferStage.saWebServer) = True 

'--- Set the progress IDs for both upload stages. 
oFileUpEE.ProgressID(saTransferStage.saClient) = oFileUpEE.NextProgressID 
oFileUpEE.ProgressID(saTransferStage.saWebServer) = oFileUpEE.NextProgressID

'--- Reset the progress IDs for both upload stages. 
oFileUpEE.ResetProgressID(saTransferStage.saClient, oFileUpEE.ProgressID)
oFileUpEE.ResetProgressID(saTransferStage.saWebServer, oFileUpEE.ProgressID);
...
In ASP:
[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 a server-to-server 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
saAllProcessed 0 All 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.
saSomeProcessed 1 Errors occurred when processing one or more files. Some files were processed without error.
saNoneProcessed 2 Errors occurred when processing all files.
saNetworkError 3 A network error stopped the upload before it was complete.
saMaxUpload 4 The upload size was greater than MaxKBytesToCancel. The upload stopped at that value.
saFileNotFound 5
saSendError 6 Generic server error.
saGeneralError 7
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 or send.aspx). The query string includes the JobId which the Resume method will need to get the status of the suspended upload.

In ASP.NET:
[C#]
... 
saResult 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) 
{
    Response.Write(@"<h2>Upload Failed</h2><br>");
    Response.Write(objFileUpEE.Error);
    Response.Write("<br><a href=send.aspx?JobId=" + objFileUpEE.JobId + 
        @">Resume upload</a>");
    Response.End();
}
...

[VB.NET]
... 
On Error Resume Next 
Dim numRetVal As saResult = 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.aspx?JobId=" & objFileUpEE.JobId & _ 
        ">Resume upload</a>")
    Response.End()
End If 
...
In ASP:
[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 or send.aspx), 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.

In ASP.NET:
[C#]
... 
//--- 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"]);
...

[VB.NET]
... 
'--- 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"))
...
In ASP:
[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
ReturnStatus (ASP Only)
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 from the web server to the file server and returns an saResult:

saResult Values
saAllProcessed 0 All 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.
saSomeProcessed 1 Errors occurred when processing one or more files. Some files were processed without error.
saNoneProcessed 2 Errors occurred when processing all files.
saNetworkError 3 A network error stopped the upload before it was complete.
saMaxUpload 4 The upload size was greater than MaxKBytesToCancel. The upload stopped at that value.
saSendError 5 Generic 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
In ASP.NET:
[C#]
FileUpEE objFileUpEE = new FileUpEE();
objFileUpEE.ProcessRequest(Page.Request, false, false);
... 
objFileUpEE(0).DestinationPath = @"C:\temp\" + objFileUpEE[0].ClientFileName;
... 
objFileUpEE.TargetUrl = @"http://localhost/fileupeescripts/fs.aspx"
... 
objFileUpEE.SendRequest();

[VB.NET]
Dim objFileUpEE As New FileUpEE()
objFileUpEE.ProcessRequest(Page.Request, False, False)
... 
objFileUpEE(0).DestinationPath = "C:\temp\" & objFileUpEE(0).ClientFileName 
... 
objFileUpEE.TargetUrl = "http://localhost/fileupeescripts/fs.aspx"
... 
objFileUpEE.SendRequest()
In ASP:
[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
In ASP.NET:
[C#]
FileUpEE objFileUpEE = new FileUpEE();
... 
objFileUpEE.AddDownloadFile(@"c:\reports\april.xls", @"c:\downloads\april.xls");
objFileUpEE.TargetUrl = @"http://localhost/fileupeedownload/fsDown.aspx"; 
objFileUpEE.SendRequest(Page.Response);
...

[VB.NET]
Dim objFileUpEE As New FileUpEE()
... 
objFileUpEE.AddDownloadFile("c:\reports\april.xls", "c:\downloads\april.xls")
objFileUpEE.TargetUrl = "http://localhost/fileupeedownload/fsDown.aspx" 
objFileUpEE.SendRequest(Page.Response)
...
In ASP:
[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
In ASP.NET:
[C#]
//--- 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. 
FileUpEE objFileUpEE = new FileUpEE();
objFileUpEE.ProcessRequest(Page.Request, true, true); 
objFileUpEE.SendResponse(Page.Response); 
Response.End();

[VB.NET]
'--- 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. 
Dim objFileUpEE As New FileUpEE()
objFileUpEE.ProcessRequest(Page.Request, True, True)
objFileUpEE.SendResponse(Page.Response) 
Response.End()
In ASP:
[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
TransferBlob (ASP.NET only)
Syntax
objFileUpEE.TransferBlob(Object pObject,long nBlobColumn,long nBlogOffset,long nBufferSize, System.Web.HttpContext pContext)
Description

TransferBlob directly writes from a database BLOB column to the HTTP Response in a download.

This method is only available in ASP.NET.

Parameters
pObject The Object to be downloaded. The derived type of this object must be either a byte array or an IDataReader. Any other type will result in an invalid data type exception.
nBlobColumn When passing in an IDataReader, the long integer nBlobColumn is used to specify the column number of the BLOB column.
nBlobOffset Long integer used to indicate the offset from the beginning of the BLOB column at which to start transferring data to the Response. When resuming a download, this offset is specified in the Range header of the request.
nBufferSize Long integer used to dictate the buffer size to be used when transferring the data from the BLOB column to the Response in KiloBytes. The default buffer size is 250KB.
pContext System.Web.HttpContext which contains the HTTP Request and HTTP Response objects. The TransferBlob method uses the Context to obtain the Response object to which it will transfer the BLOB column.
Example:
[C#]
//--- Create database connection string
String connectString = "Server=SQLServer;uid=userid;pwd=password;database=Files";

//--- Create FileUpEE object, set the TransferStage to Web Server
//--- and enable resumability.  Then, process the request
FileUpEe oFileUpEE = new FileUpEe();
oFileUpEE.TransferStage = saTransferStage.saWebServer;
oFileUpEE.set_Resumable(saTransferStage.saWebServer,true);
oFileUpEE.ProcessRequest(Request, false, false);

//--- Connect to the database and return an IDataReader object
SqlConnection conn = new SqlConnection(connectString);
SqlCommand sqlcmd = new SqlCommand("SELECT Filename, FileData" +
    " FROM FileSave WHERE FileID = '8'", conn);
conn.Open();
SqlDataReader dr = sqlcmd.ExecuteReader(CommandBehavior.SequentialAccess);

//--- Peform TransferBlob with IDataReader dr.
try
{
    oFileUpEE.TransferBlob(dr, 1, oFUEE.RequestRange, 0, Context);
    Response.SuppressContent = true;
    Response.Flush();
}
catch (Exception ex)
{
    Response.Write("Error Transferring Binary Large Object: " + ex.Message);
}

[VB.NET]
'--- Create database connection string
Dim connectString As String = "Server=SQLServer;uid=userid;pwd=password;database=Files"

'--- Create FileUpEE object, set the TransferStage to Web Server
'--- and enable resumability.  Then, process the request
Dim oFileUpEE As New FileUpEe()
oFileUpEE.TransferStage = saTransferStage.saWebServer
oFileUpEE.Resumable(saTransferStage.saWebServer) = True
oFileUpEE.ProcessRequest(Request, False, False)

'--- Connect to the database and return an IDataReader object
Dim conn As New SqlConnection(connectString)
Dim sqlcmd As New SqlCommand("SELECT Filename, FileData" & _
    " FROM FileSave WHERE FileID = '8'", conn)
conn.Open()
Dim dr As SqlDataReader = sqlcmd.ExecuteReader(CommandBehavior.SequentialAccess)

'--- Peform TransferBlob with IDataReader dr.
Try
    oFileUpEE.TransferBlob(dr, 1, oFUEE.RequestRange, 0, Context)
    Response.SuppressContent = True
    Response.Flush()
Catch ex As Exception
    Response.Write("Error Transferring Binary Large Object: " + ex.Message)
End Try
Top
TransferFile
Syntax
[ASP]
objFileUpEE.TransferFile(Request,Response,[FileName],[URL])

[ASP.NET]
objFileUpEE.TransferFile(HttpContext Context, string [FileName], string [URL], Boolean [Overwrite])
Description

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

In a two-tier download, do not set the URL parameter.

In a three-tier download, set the URL parameter to the address of the file server page that will transfer the file from file server to web server. The FileName parameter must be set to the location of the file on the file server. The resulting download is a streaming download that is not cached into temporary directories on the file server or the web server.

Parameters
Request (ASP) The Request object.
Response (ASP) The Response object.
Context (ASP.NET) The HttpContext object. In a three tier download, this is the only parameter that should be passed into the FileUpEE.TransferFile() method in the file server code.
[FileName] Optional. The path and name of the file to download. This parameter must be set on the web server. In a 3-tier download, the value of FileName should be the location of the file on the file server. Use this parameter in the web server code of a 3-tier download, but not in the file server code.
[URL] Optional. In a 3-tier download, set the URL parameter to the address of the file server page that will transfer the file from file server to web server. Use this parameter in the web server code of a 3-tier download, but not in the file server code.
Examples:

When performing a 3-tier download, call TransferFile on the web server and file server. The optional FileName parameter should specify the location of the file on the file server. The optional URL parameter should specify the URL of the file server page that will transfer the file from the file server to the web server.

In ASP.NET:
[C#]
//--- From the web server page in a 3-tier download.
objFileUpEE.TransferStage = saTransferStage.saWebServer;
objFileUpEE.TransferFile(Context, @"C:\Images\image.gif", 
     @"http://FileServer/download.aspx");
...
     
//--- From the file server page in a 3-tier download.
objFileUpEE.TransferStage = saTransferStage.saFileServer;

objFileUpEE.TransferFile(Context);


[VB.NET]
'--- From the web server page in a 3-tier download.
objFileUpEE.TransferStage = saTransferStage.saWebServer
objFileUpEE.TransferFile(Context, "C:\Images\image.gif", _
     "http://FileServer/download.aspx")
...

'--- From the file server page in a 3-tier download.
objFileUpEE.TransferStage = saTransferStage.saFileServer

objFileUpEE.TransferFile(Context)
In ASP:
[VBScript] 
'--- From the web server page in a 3-tier download. 
objFileUpEE.TransferStage = saWebServer
objFileUpEE.TransferFile Request, Response, _
    "C:\Images\image.gif", "http://FileServer/download.asp"
...

'--- From the file server page in a 3-tier download. 
objFileUpEE.TransferStage = saFileServer
objFileUpEE.TransferFile Request, Response

When performing a 2-tier download, do not pass the URL parameter:

In ASP.NET:
[C#]
oFileUpEE.TransferStage = saTransferStage.saWebServer;
string strPathToDownloadFile = Server.MapPath(@"/FileUpEE/Samples/sample.doc");
oFileUpEE.TransferFile(Context, strPathToDownloadFile);

[VB.NET]
oFileUpEE.TransferStage = saTransferStage.saWebServer
Dim strPathToDownloadFile As String = Server.MapPath("/FileUpEE/Samples/sample.doc")
oFileUpEE.TransferFile(Context, strPathToDownloadFile)
In ASP:
              
[VBScript]
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.

In ASP.NET:
[C#]
Boolean bRetVal = objFileUpEE.ValidateChecksums();
if (!bRetVal)
{
	objFileUpEE.Error = "Checksum validation failed";
}

[VB.NET]
Dim bRetVal As Boolean = objFileUpEE.ValidateChecksums()
If bRetVal = False Then
	objFileUpEE.Error = "Checksum validation failed"
End If
In ASP:
[VBScript]
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

Copyright © 2010 SoftArtisans, Inc. All rights reserved.