Object Model FileUpEE FileCollection FileEE SoapEnvelope
SoapHeaders SoapHeaderElement Progress Object

The FileEE Object

The FileEE object represents a single file in a file transfer.

FileEE PropertiesFileEE Methods
Body DbPrimaryKeyValue OverwriteFile Download
Checksum DbSchema Params Save
ChunkSize DbSqlCommand PreserveMacBinary   SaveAsBlob
ClientFileName DbTableName PreviousChecksum SaveAs
ClientPath DestinationFileName Processed ValidateChecksum
ContentDisposition DestinationPath SaveMethod WriteToResponse
ContentId DownloadedFileName Size
ContentType DownloadedPath TempFile
DbConnection Error UseChecksum
DbFileColumnName FileMethod
DbIdentityColumnName Name
DbPrimaryKey

FileEE Properties
Body
Syntax

objFileEE.Body [= Byte Array or String]

Description

Body contains the contents of the file represented by the specified instance of FileEE.

Body is a Read/Write property.

Example
Response.Write objFileUpEE(0).Body
	

Top

Checksum
Syntax

objFileEE.Checksum

Description

FileUpEE allows you to verify the integrity of data uploaded from Web server to file server. If FileEE.UseChecksum is enabled on the Web server, FileUpEE will generate a file content checksum for the specified file and send the file's checksum with the upload to the file server. On the file server, use FileEE.ValidateChecksum to verify that the data was not corrupted during transfer.

Checksum contains the file content checksum that was generated on the file server, after the upload was received.

Checksum is a Read Only 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-upload checksums, see FileUpEE.UseChecksum and FileUpEE.ValidateChecksums.

For more information on using per-file checksums, see FileEE.ContentChecksum, FileEE.UseChecksum, and FileEE.ValidateChecksum.

Top

ChunkSize
Syntax

objFileEE.ChunkSize [= Size in KiloBytes]

Description

When transferring a file to or from a database, FileUpEE does not transfer the whole file at once; a file is uploaded to or downloaded from a database in data chunks. ChunkSize sets the size in kilobytes of a data chunk. Setting ChunkSize allows you to fine tune performance based on your network and database.

ChunkSize is a Read/Write property.

Top

ClientFileName
Syntax

objFileEE.ClientFileName [= File Name]

Description

ClientFileName returns the original file name of an uploaded file, without a path.

ClientFileName is a Read Only property.

Example
<% ...
objFileUpEE(1).SaveMethod = saDatabase
...	
dbFileName = objFileUpEE(1).ClientFileName
objFileUpEE(1).DbSchema.Add "File Name", dbFileName
... %>
	
Top
ClientPath
Syntax

objFileEE.ClientPath [= Path and File Name]

Description

In a upload, ClientPath returns the original path and file name of the uploaded file. In a download, ClientPath sets the file's destination path and file name.

ClientPath is a Read/Write property.

Example
<% ...
For each file in objFileUpEE.Files	
	Response.Write "Original file name and location: " & File.ClientPath
	...
next
%>
	
Top
ContentDisposition
Syntax

objFileEE.ContentDisposition [= MIME Content-Disposition as String]

Description

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

Top
ContentId
Syntax

objFileUpEE(Key).ContentId [= String]

Description

ContentId specifies a unique content-id for each file in a file transfer. FileUpEE automatically generates a ContentId. Alternatively, you may set ContentId in script.

ContentId is a Read/Write property.

See Also

SOAP Messages with Attachments and MIME Part One: Format of Internet Message Bodies.

Example
<% ...
objFileUpEE(1).SaveMethod = saDatabase
objFileUpEE(1).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(1).DbTableName = "Images"
	
dbFileName = objFileUpEE(1).ClientFileName	
objFileUpEE(1).DbSchema.Add "File Name", dbFileName
objFileUpEE(1).DbSchema.Add "ContentId", objFileUpEE(1).ContentId
... %>
	
Top
ContentType
Syntax

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

Description

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

ContentType is a Read/Write property.

Top
DbConnection
Syntax

objFileUpEE(Key).DbConnection [= Connection String]

Description

Use DbConnection to set the database connection string when transferring a file to or from a database.

DbConnection is a Read/Write property.

See Also

Per-upload database properties: FileUpEE.DbConnection, FileUpEE.DbPrimaryKey, FileUpEE.DbPrimaryKeyValue, FileUpEE.DbSqlCommand, FileUpEE.DbTableName, and FileUpEE.SaveMethod.

Per-file database properties: FileEE.DbFileColumnName, FileEE.DbPrimaryKey, FileEE.DbPrimaryKeyValue, FileEE.DbSqlCommand, FileEE.DbTable, FileEE.SaveAsBlob, FileEE.SaveMethod, and FileEE.DbSchema.

Example
objFileUpEE(1).DbConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=C:\Uploads\Images.mdb;" & _
    "Persist Security Info=False"
	
Top
DbFileColumnName
Syntax

objFileUpEE.DbFileColumnName [= File Column Name as String]

When transferring a file to or from a database, set DbFileColumnName to the name of the table column that contains the file.

DbFileColumnName is a Read/Write property.

See Also

Per-upload database properties: FileUpEE.DbConnection, FileUpEE.DbPrimaryKey, FileUpEE.DbPrimaryKeyValue, FileUpEE.DbSqlCommand, FileUpEE.DbTableName, and FileUpEE.SaveMethod.

Per-file database properties: FileEE.DbConnection, FileEE.DbPrimaryKey, FileEE.DbPrimaryKeyValue, FileEE.DbSqlCommand, FileEE.DbTable, FileEE.SaveAsBlob, FileEE.SaveMethod, and FileEE.DbSchema.

Example
...
objFileUpEE(1).SaveMethod = saDatabase
objFileUpEE(1).DbTableName = "Files"
objFileUpEE(1).DbConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
	    "Data Source=[PATH]\FileUpEE\files.mdb;" & _
	    "Persist Security Info=False"   
dbFileName = objFileUpEE(1).ClientFileName   
objFileUpEE(1).DbSchema.Add "FileName", dbFileName 
objFileUpEE(1).DbSchema.Add "ContentId", objFileUpEE(1).ContentId
objFileUpEE(1).DbFileColumnName = "File"
...	
Top
DbIdentityColumnName
Syntax

objFileUpEE.DbIdentityColumnName = [= Identity Column Name]

Description

When uploading to a database, if DbIdentityColumnName is set, FileUpEE will return the identity value for the new row. The row identity value will be in the DbSchema collection under the name of the identity column specified by DbIdentityColumnName. For example, if a file's identity column is set to "FileId," after SendRequest returns, the file's DbSchema("FileId") collection member will hold the identity value for that database row.

Example
objFileUpEE(1).DbIdentityColumnName = "FileId"
	
Top
DbPrimaryKey
Syntax

objFileUpEE(Key).DbPrimaryKey [= Primary Key Column Name]

Description

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

When uploading a file 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

Per-upload database properties: FileUpEE.DbConnection, FileUpEE.DbPrimaryKey, FileUpEE.DbPrimaryKeyValue, FileUpEE.DbSqlCommand, FileUpEE.DbTableName, and FileUpEE.SaveMethod.

Per-file database properties: FileEE.DbConnection, FileEE.DbFileColumnName, FileEE.DbPrimaryKeyValue, FileEE.DbSqlCommand, FileEE.DbTable, FileEE.SaveAsBlob, FileEE.SaveMethod, and FileEE.DbSchema.

Example
	<% ...
	objFileUpEE(2).DbTableName = "Files"
	objFileUpEE(2).DbSqlCommand = "Select * from Files where FileId = 184"
	objFileUpEE(2).DbPrimaryKey = "FileId"
	objFileUpEE(2).DbPrimaryKeyValue = "6325"
	...%>
	
Top
DbPrimaryKeyValue
Syntax

objFileUpEE(Key).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

Per-upload database properties: FileUpEE.DbConnection, FileUpEE.DbPrimaryKey, FileUpEE.DbPrimaryKeyValue, FileUpEE.DbSqlCommand, FileUpEE.DbTableName, and FileUpEE.SaveMethod.

Per-file database properties: FileEE.DbConnection, FileEE.DbFileColumnName, FileEE.DbPrimaryKey, FileEE.DbSqlCommand, FileEE.DbTable, FileEE.SaveAsBlob, FileEE.SaveMethod, and FileEE.DbSchema.

Example
	<% ...
	objFileUpEE(1).DbTableName = "Files"
	objFileUpEE(1).DbSqlCommand = "Select * from Files where FileId = 184"
	objFileUpEE(1).DbPrimaryKey = "FileId"
	objFileUpEE(1).DbPrimaryKeyValue = "6954"
	...%>
	
Top
DbSchema
Syntax

objFileUpEE.DbSchema.Add Column Name, Value

Description

DbSchema is a collection of name-value pairs representing the column names and values of a database row. Use DbSchema to add or update a database field.

DbSchema is a Read Only property.

See Also

Per-upload database properties: FileUpEE.DbConnection, FileUpEE.DbPrimaryKey, FileUpEE.DbPrimaryKeyValue, FileUpEE.DbSqlCommand, FileUpEE.DbTableName, and FileUpEE.SaveMethod.

Per-file database properties: FileEE.DbConnection, FileEE.DbFileColumnName, FileEE.DbPrimaryKey, FileEE.DbPrimaryKeyValue, FileEE.DbSqlCommand, FileEE.DbTable, FileEE.SaveAsBlob, and FileEE.SaveMethod.

Example
<% ...
objFileUpEE(1).SaveMethod = saDatabase
objFileUpEE(1).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(1).DbTableName = "Images"
	
dbFileName = objFileUpEE(1).ClientFileName
objFileUpEE(1).DbSchema.Add "File Name", dbFileName
objFileUpEE(1).DbSchema.Add "ContentId", objFileUpEE(1).ContentId
... %>
	
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

Per-upload database properties: FileUpEE.DbConnection, FileUpEE.DbPrimaryKey, FileUpEE.DbPrimaryKeyValue, FileUpEE.DbSqlCommand, FileUpEE.DbTableName and FileUpEE.SaveMethod.

Per-file database properties: FileEE.DbConnection, FileEE.DbFileColumnName, FileEE.DbPrimaryKey, FileEE.DbPrimaryKeyValue, FileEE.DbTableName, FileEE.SaveAsBlob, FileEE.SaveMethod, and FileEE.DbSchema.

Example
	<% ...
	objFileUpEE.DbTableName = "Files"
	objFileUpEE.DbSqlCommand = "Select * from Files where FileId = 184"
	objFileUpEE.DbPrimaryKey = "FileName"
	objFileUpEE.DbPrimaryKeyValue = "file.txt"
	...%>
	
Top
DbTableName
Syntax

objFileUpEE(Key).DbTableName [= Database Table Name]

Description

When uploading a file 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.

DbTableName is a Read/Write property.

See Also

Per-upload database properties: FileUpEE.DbConnection, FileUpEE.DbPrimaryKey, FileUpEE.DbPrimaryKeyValue, FileUpEE.DbSqlCommand, FileUpEE.DbTableName, and FileUpEE.SaveMethod.

Per-file database properties: FileEE.DbConnection, FileEE.DbFileColumnName, FileEE.DbPrimaryKey, FileEE.DbPrimaryKeyValue, FileEE.DbSqlCommand, FileEE.SaveAsBlob, FileEE.SaveMethod, and FileEE.DbSchema.

Example
<% ...
objFileUpEE(1).SaveMethod = saDatabase
objFileUpEE(1).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(1).DbTableName = "Images"
	
dbFileName = objFileUpEE(1).ClientFileName	
objFileUpEE(1).DbSchema.Add "File Name", dbFileName
objFileUpEE(1).DbSchema.Add "ContentId", objFileUpEE(1).ContentId
... %>
	
Top
DestinationFileName
Syntax
objFileUpEE(Key).DestinationFileName [=File Name]
Description

DestinationFileName specifies the name with which to save an uploaded file. DestinationFileName does not include a directory path. If you assign DestinationFileName, use FileUpEE.DestinationDirectory to set the Save directory.

Alternatively, use DestinationPath.

Example
objFileUpEE.DestinationDirectory = "C:\Uploads\Images\"
objFileUpEE(0).DestinationFileName = "image1.jpg"
	
Top
DestinationPath
Syntax
objFileUpEE(Key).DestinationPath [=Server Path & File Name]
Description

When uploading a file to a directory, set DestinationPath to the Save location. Set DestinationPath to a complete directory path and file name.

DestinationPath is a Read/Write property.

Alternatively, use FileUpEE.DestinationDirectory with DestinationFileName.

Example
objFileUpEE(0).DestinationPath = "C:\Uploads\Images\file.gif"
	
Top
DownloadedFileName
Syntax

objFileUpEE.DownloadedFileName [=File Name]

Description

DownloadedFileName sets or returns the name of a downloaded file on the client, without a path.

DownloadedFileName is a Read/Write property.

Top
DownloadedPath
Syntax

objFileUpEE.DownloadedPath [=Path & File Name]

Description

DownloadedPath sets or returns the path and name of a downloaded file on the client.

DownloadedPath is a Read/Write property.

Top
Error
Syntax

objFileUpEE.Error

Description

Error returns a helpful error message, if an error occurred when transferring the specified file.

Error is a Read Only property.

Example

The following example displays an error message to the user if Processed returns 2 (saError).

...
For each file in objFileUpEE.Files
	...
	If file.Processed = 2 then
		Response.Write "Error uploading " &_
			 file.ClientFileName & ":<br>"
		Response.Write file.Error
	End if
	...
Next
	
Top
FileMethod
Syntax

objFileUpEE.FileMethod [=saFileMethod]

Description

For server-to-server file transfers, FileMethod sets the transfer type.

FileMethod is a Read/Write property.

Parameter

Set FileMethod to an saFileMethod name or number:

saFileMethod Values
saUpload0
saDownload1
saRoundtrip2

Top

Name
Syntax

objFileEE.Name [= String]

Description

When uploading a file from a Web form, Name returns the the value of the <INPUT> field's name attribute. For example, if a file is uploaded from <INPUT type="file" name="file1">, its objFileEE.Name value will be "file1".

To reference a single file in a multi-file upload, you can use the value of Name as the file's key.

Name is a Read/Write property.

Example
Set objFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
...
objFileUpEE(0).Name = "FirstFile"
objFileUpEE("FirstFile").OverwriteFile = False 
...
	
Top
OverwriteFile
Syntax

objFileEE.OverwriteFile [= Boolean]

Description

When set to True, an uploaded file will overwrite an existing file with the same name. When set to False, the uploaded file will not be saved if a file with the same name exists.

OverwriteFile is a Read/Write property, and is set to True by default.

See Also
To set this property for all files in an upload, use FileUpEE.OverwriteFiles.

Top
Params
Syntax

objFileEE.Params.Add Param Name, Param Value

Description

Params is a key/value collection that may be used to send custom values with a SOAP request from Web server to file server.

Params is a Read Only property.

Top
PreserveMacBinary
Syntax

objFileUpEE.PreserveMacBinary [= Boolean]

Description

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

PreserveMacBinary is a Read/Write property.

Example
objFileEE.PreserveMacBinary = True
	
Top
PreviousChecksum
Syntax

objFileEE.PreviousChecksum

Description

FileUpEE allows you to verify the integrity of data uploaded from Web server to file server. If FileEE.UseChecksum is enabled on the Web server, FileUpEE will generate a file content checksum for the specified file and send the file's checksum with the upload to the file server. On the file server, use FileEE.ValidateChecksum to verify that the data was not corrupted during transfer.

PreviousChecksum contains the file content checksum that was generated on the Web server, before the upload was sent to the file server.

PreviousChecksum is a Read Only 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-upload checksums, see FileUpEE.UseChecksum and FileUpEE.ValidateChecksums.

For more information on using per-file checksums, see FileEE.Checksum, FileEE.UseChecksum, and FileEE.ValidateChecksum.

Top
Processed
Syntax

objFileEE.Processed [=saSaveResult]

Description

Specifies the status of an upload.

Processed is a Read/Write property.

Parameter
saSaveResult Values
saSaved0Uploaded file saved.
saDownloaded0File downloaded.

Use this value to check the success of a server-to-server download. You cannot use this value to verify that a download was processed successfully on a client.
saExists1The file was not saved because OverwriteFile is set to False and a file with the same name exists in the destination directory.
saError2An error occurred.
Example

The following example displays an error message to the user if Processed returns 2 (saError).

...
For each file in objFileUpEE.Files
	...
	If file.Processed = 2 then
		Response.Write "Error uploading " &_
			 file.ClientFileName & ":<br>"
		Response.Write file.Error
	End if
	...
Next
Top
SaveMethod
Syntax

objFileUpEE.SaveMethod [= saSaveMethod]

Description

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

Parameter

Set SaveMethod to an saSaveMethod by name or number:

saSaveMethod Values
saDatabase0
saDiskFile1 (Default value)
See Also

FileUpEE.SaveMethod

Example
<% ...
objFileUpEE(1).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(1).ClientFileName
objFileUpEE(1).DbSchema.Add "File Name", dbFileName
... %>
	
Top
Size
Syntax

objFileEE.Size

Description

Size returns the size of the uploaded file, in bytes.

Size is a Read Only property.

Note

FileUpEE can read the size of a file on the server, that is, before download or after upload. Size cannot be used for client-side file size filtering.

Top
TempFile
Syntax

objFileEE.TempFile [= Temp Directory]

Description

When a file is uploaded to a server, it is cached. TempFile specifies the uploaded file's temporary directory and name on the server. By default, uploads will be cached in the system's default directory for cached files, typically c:\winnt\temp.

After the file is saved, the value of TempFile is the same as the value of DestinationPath.

TempFile is a Read only property.

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.
Top
UseChecksum
Syntax

objFileUpEE.UseChecksum [= Boolean]

Description

FileUpEE 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 specified file and send the file's checksum with the upload to the file server. On the file server, use FileEE.ValidateChecksum to verify that the data was not corrupted during transfer.

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-upload checksums, see FileUpEE.UseChecksum and FileUpEE.ValidateChecksums.

For more information on using per-file checksums, see FileEE.Checksum, FileEE.ContentChecksum, and FileEE.ValidateChecksum.

Top


FileEE Methods
Download
Syntax

objFileEE.Download

Description

When downloading a file from a file server to a Web server, if in the file server script AutoProcess is set to False, call Download.

Call Download after setting ClientPath and DownloadedPath. Call Download before calling SendResponse.

Example

In the following example the download request is sent from Web server to file server, but the download source and destination directories are set on the file server. Since the file server script does not automatically execute instructions from the web server script, AutoProcess is set to False, and the file server script must call download.

Web server script:

Set objFileUpEE = Server.CreateObject("SoftArtisans.FileUpEe")
objFileUpEE.ProcessRequest Request, True, False
objFileUpEE.ProcessRequest Request 
'--- You can pass empty strings to AddDownloadFile, and 
'--- set the download source and destination directories 
'--- on the file server. 
objFileUpEE.AddDownloadFile "", ""
objFileUpEE.TargetUrl = "http://localhost/fileupee/Download/DownloadFS.asp"
objFileUpEE.SendRequest Response 
	

File server script:

Set objFileUpEE = Server.CreateObject("SoftArtisans.FileUpEe")
objFileUpEE.ProcessRequest Request, True, False
'--- Source path:
objFileUpEE(0).DownloadedPath = "c:\images\file.gif"
'--- Destination path:
objFileUpEE(0).ClientPath = "c:\downloads\file.gif"
objFileUpEE(0).Download
objFileUpEE.SendResponse Response
Response.End
	
Top
Save
Syntax

objFileUpEE.Save()

Description

Saves an uploaded file to a directory or a database, depending on the value of SaveMethod.

When saving to a directory, set either FileEE.DestinationPath or FileUpEE.DestinationDirectory and FileEE.DestinationFileName.

For instructions on saving a file to a database (adding or updating a record), see FileUpEE.DbConnection, FileUpEE.DbPrimaryKey, FileUpEE.DbPrimaryKeyValue, FileUpEE.DbSqlCommand, FileUpEE.DbTableName, FileEE.DbConnection, FileEE.DbPrimaryKey, FileEE.DbPrimaryKeyValue, FileEE.DbSchema FileEE.DbSqlCommand, and FileUpEE.DbTableName.

See Also

FileEE.SaveAsBlob and FileEE.SaveAs

Example
Set objFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
objFileUpEE.ProcessRequest Request
...
FileName = objFileUpEE(0).ClientFileName 
objFileUpEE(0).DestinationPath = "c:\temp\upload\" & FileName
objFileUpEE(0).Save
...	
Top
SaveAsBlob
Syntax

objFileUpEE.SaveAsBlob (Variant Blob)

Description

Saves a file to a database. You can also save to a database by setting SaveMethod to saDatabase and calling the Save method.

Top
SaveAs
Syntax

objFileUpEE.SaveAs (Path & File Name)

Description

Saves a file to a directory specified by the method's FileName parameter.

Example
Set objFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
objFileUpEE.ProcessRequest Request
...
FileName = objFileUpEE(0).ClientFileName 
objFileUpEE(0).SaveAs "c:\temp\upload\" & FileName
	
Top
ValidateChecksum
Syntax

objFileUpEE.ValidateChecksum

Description

Use ValidateChecksum to verify the integrity of data transferred from Web server to file server. If FileEE.UseChecksum is set to True on the Web server, FileUpEE will generate a content checksum for the specified file 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 file content checksum received from the Web server and the checksum generated on the file server are identical, ValidateChecksums returns True. If the file checksums are not identical, the file was corrupted during transfer, and ValidateChecksum returns False.

See Also

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

For more information on using per-file checksums, see FileEE.Checksum, FileEE.ContentChecksum, and FileEE.UseChecksum.

Top
WriteToResponse
Syntax

objFileUpEE.WriteToResponse(Response)

Description

WriteToResponse writes the specified file to the ASP Response.

Using WriteToResponse in a Server-to-Client Download

When downloading a file from a Web server to a client, use WriteToResponse to send the file to the browser. See, A Simple Download.

Using WriteToResponse in a Server-to-Server-to-Client Download

WriteToResponse allows you to include operations in script that will be executed between a file's arrival on the Web server and its transfer to the client.

If in the Web server script, you pass the ASP Request object to SendRequest, the file will be downloaded from the file server to the Web server, and immediately sent to the client. If you do not pass the ASP Request object to SendRequest, the file will be downloaded to the Web server, but will not be sent to the client. Later in the script, you can use WriteToResponse to send the file to the client.

Note

To let the browser know how to handle a download, set the content-type response header to the file's ContentType before sending the file to the browser.

Example

The following is the Web server script in a download from file server to Web server to client. The script gets the download source and destination directories from a form.

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()
...
'--- Script included between SendRequest() and WriteToResponse 
'--- will be executed after a file is downloaded to the Web 
'--- server but before it is transferred to the client.
...
If objFileUpEE(0).Processed = saSaved then
	objFileUpEE(0).WriteToResponse(Response)
End if
	
Top
Object Model FileUpEE FileCollection FileEE SoapEnvelope
SoapHeaders SoapHeaderElement Progress Object


Copyright © 2003, SoftArtisans, Inc.