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. 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. |
|
|
|
XFileEE includes a client-side progress indicator that can monitor the upload of individual files from client to web server. To learn how to use XFileEE's progress indicator, see the XFileEE documentation at FileUpEE/XFile/XFile.chm.
In this 3-tier upload example, the progress indicator is displayed in a pop-up browser window.
The progress indicator example includes four scripts:
Form.asp contains the upload form. Form.asp creates two instances of the progress indicator for the two stages of the upload - client to web server and web server to file server:
Set oFileUpEEProgressWS = Server.CreateObject("SoftArtisans.FileUpEEProgress")
Set oFileUpEEProgressClient = Server.CreateObject("SoftArtisans.FileUpEEProgress")
The Watch
property specifies the stage of the upload to monitor. In Form.asp, one progress
indicator is set to monitor the upload from client to Web server (transfer stage
saClient
), and the other is set monitor the upload from web server
to file server (transfer stage saWebServer
):
'--- 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
The NextProgressID
method generates progress ids for both stages of the upload - client to web server
and web server to file server:
'--- Get a new progress ID for the client > web server layer
clProgID = oFileUpEEProgressClient.NextProgressID
'--- Get a new progress ID for the web server > file server layer
wsProgID = oFileUpEEProgressWS.NextProgressID
The two ProgressId
s
generated for the two stages of the upload will be identical. The ProgressId
s
will be passed to WebServer.asp and to Progress.asp through the startUpload()
function. Clicking Upload File will call startupload()
. The
function submits the upload request with the progress ids to WebServer.asp, and
opens the progress indicator window (Progress.asp), passing it the two progress
ids:
function startUpload()
{
winstyle=
"height=150,
width=560,
status=no,
scrollbars=no,
toolbar=no,
menubar=no,
location=no";
window.open("progress.asp?
wprogressid=<%=wsProgID%>
&cprogressid=<%=clProgID%>",
null,
winstyle);
document.theForm.action=
"webserver.asp?
wprogressid=<%=wsProgID%>
&cprogressid=<%=clProgID%>";
}
Progress.asp is the pop-up progress indicator. The upload progress is displayed within an HTML table. For each stage of the upload, the table dispays: the progress id, a visual progress indicator, the number of bytes transferred so far, the percentage of bytes transferred so far, and total bytes to transfer.
The progress indicator monitors the whole upload. It does not watch the progress of an individual file within an upload. |
As in Form.asp, two FileUpEEProgress
objects are created for the two stages of the upload - client to web server and
web server to file server. For each instance of the FileUpEEProgress
object, the Watch
property is set to the appropriate transfer stage
(saClient
or saWebServer
).
Set oFileUpProgressClient = Server.CreateObject("Softartisans.FileUpEEProgress")
Set oFileUpProgressWS = Server.CreateObject("Softartisans.FileUpEEProgress")
oFileUpProgressClient.Watch = saClient
oFileUpProgressWS.Watch = saWebServer
The client and web server progress ids that were submitted in the query string are
passed to the appropriate FileUpEEProgress
objects:
oFileUpProgressClient.ProgressID = CInt(request.querystring("cprogressid"))
oFileUpProgressWS.ProgressID = CInt(request.querystring("wprogressid"))
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, which is not proof of arrival on the file server. |
WebServer.asp runs on the web server. It includes all upload processing information.
WebServer.asp sends the upload request to the file server script set by the TargetURL
property. The request to the file server is a SOAP message (an XML file).
To enable progress indication, the
FileUpEE
object's
ProgressIndicator
property must be set to true
for both upload stages:
oFileUpEE.ProgressIndicator(saClient) = True
oFileUpEE.ProgressIndicator(saWebServer) = True
The progress ids that were submitted in the query string must be passed to the
FileUpEE
object's ProgressID(saClient)
and ProgressID(saWebServer)
properties:
oFileUpEE.ProgressID(saClient) = CInt(request.querystring("cprogressid"))
oFileUpEE.ProgressID(saWebServer) = CInt(request.querystring("wprogressid"))
FileServer.asp is executed on the file server. FileServer.asp does not include upload
processing instructions; it automatically executes the instructions that were set
in WebServer.asp and sent from the web server as a SOAP message. FileUpEE automatically
processes the request according to the SOAP message because AutoProcess
- the third parameter of
ProcessRequest
- is set to True
.
NextProgressID |
The NextProgressId method returns the next unused ProgressId . |
---|---|
Percentage |
The Percentage property returns the percentage of the upload that was:
|
ProgressId |
The ProgressId property sets or returns a progress id number for an
upload. |
TotalBytes |
The TotalBytes property returns the total number of bytes to be uploaded.
|
TransferredBytes |
The TransferredBytes property returns the number of bytes that were:
|
Watch |
The Watch property specifies the transfer stage that the progress indicator
should watch: saClient or saWebServer . |