The Progress Object

FileUpEE includes a server-side progress indicator that allows you to log and display the progress of an upload. Note that the progress indicator monitors the whole upload, and cannot watch the progress of an individual file within an upload. You can, however, monitor the progress of individual files by using XFileEE's client-side progress indicator.

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.


FileUpEEProgress 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 Import 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 the progress object in an ASP.NET page, use:

In C#:      FileUpEeProgress oFileUpEEProgress = new FileUpEeProgress();
In VB.NET:  Dim oFileUpEEProgress As New FileUpEeProgress()

FileUpEEProgress in ASP

To create an instance of the progress indicator in an ASP page, use:

Set objFileUpProgress = Server.CreateObject("Softartisans.FileUpEEProgress")

Progress Indicator Properties     Progress Indicator Methods
Percentage Dispose
ProgressId NextProgressID
TotalBytes
TransferredBytes
Watch
Progress Indicator Properties
Percentage
Syntax
objProgress.Percentage
Description

The Percentage property returns the percentage of the upload that was:

  • Received on the web server (if the upload is from client to web server)

    OR

  • Sent to the file server (if the upload is from web server to file server)
Top
ProgressId
Syntax
objProgress.ProgressId [=Progress Id]
Description

The ProgressId property sets or returns a progress id number for an upload. FileUpEE automatically generates a unique progress id for each upload.

Top
TotalBytes
Syntax
objProgress.TotalBytes
Description

The TotalBytes property returns the total number of bytes to be uploaded.

Top
TransferredBytes
Syntax
objProgress.TransferredBytes
Description

The TransferredBytes property returns the number of bytes that were:


  • Received on the web server (if the upload is from client to web server)

    OR

  • Sent to the file server (if the upload is from web server to file server)
Top
Watch
Syntax
objProgress.Watch =SATransferStage
Description

The Watch property specifies the transfer stage that the progress indicator should watch: saClient for client to web server, or saWebServer for web server to file server.

Example

The following is from the client script (upload form) in a 3-tier (client to web server to file server) upload:

In ASP.NET:
[C#]
//--- Watch the upload from client to web server. That is, 
//--- monitor the upload as it is RECEIVED on the web server. 
oFileUpEEProgressClient.Watch = saTransferStage.saClient;
                    
//--- Watch the upload from web server to file server. That 
//--- is, monitor the upload as it is SENT FROM the web server. 
oFileUpEEProgressClient.Watch = saTransferStage.saWebServer;

[VB.NET]
'--- Watch the upload from client to web server. That is, 
'--- monitor the upload as it is RECEIVED on the web server. 
oFileUpEEProgressClient.Watch = saTransferStage.saClient
                    
'--- Watch the upload from web server to file server. That 
'--- is, monitor the upload as it is SENT FROM the web server. 
oFileUpEEProgressClient.Watch = saTransferStage.saWebServer
In ASP:
[VBScript]
'--- Watch the upload from client to web server. That is, 
'--- monitor the upload as it is RECEIVED on the web server. 
oFileUpEEProgressClient.Watch = saClient
                    
'--- Watch the upload from web server to file server. That 
'--- is, monitor the upload as it is SENT FROM the web server. 
oFileUpEEProgressClient.Watch = saWebServer
Top



Progress Indicator Methods
Dispose
Syntax
objProgress.Dispose
Description

When you are finished using an instance of the progress indicator under .NET, always call Dispose to ensure thorough cleanup of the FileUpEEProgress object.

Example
[C#]
finally
{
    //--- Always call FileUpEEProgress.Dispose() in finally
    if(oFileUpEEProgress!=null)
	    oFileUpEEProgress.Dispose();
	oFileUpEEProgress = null;
}

[VB.NET]
Finally
    '--- Always call FileUpEEProgress.Dispose() in finally
    If Not oFileUpEEProgress = Nothing
	    oFileUpEEProgress.Dispose()
	oFileUpEEProgress = Nothing
End Try
Top
NextProgressID
Syntax
objProgress.NextProgressID
Description

NextProgressId returns the next unused ProgressId.

Example
In ASP.NET:
[C#]
int ProgID = oFileUpEEProgress.NextProgressID();

[VB.NET]
Dim ProgID As Integer = oFileUpEEProgress.NextProgressID()
ProgID = oFileUpEEProgress.NextProgressID
Top

Copyright © 2010 SoftArtisans, Inc. All rights reserved.