To display a helpful message in the event of an error, use JFile's
ErrorURL parameter.
The ErrorURL parameter specifies the URL of a page to display when an error
occurs. When you set the ErrorURL parameter, JFile will add an error code
to the URL's query string. For example, if ErrorURL is set to http://localhost/jfilescripts/errorpage.asp ,
JFile will send the query string http://localhost/jfilescripts/errorpage.asp?jfile_errorcode=number .
|
|
SoftArtisans JFile error <% =Request.QueryString("jfile_errorcode") %> occurred.
<APPLET codebase="/JFileScripts" code="softartisans.filetransfer.UploadClient.class"
height="0" width="0" mayscript archive="filetransfer.jar" name="fileupload">
<!-- The Cabbase parameter specifies the cab file containing the applet. -->
<PARAM name="cabbase" value="filetransfer.cab">
<!-- The ErrorURL parameter contains the URL of a file to open when an error occurs. -->
<PARAM name="ErrorURL" value="http://localhost/jfilescripts/errorpage.asp">
<!-- The PostURL parameter specifies the URL to which the file will be posted. -->
<PARAM name="PostURL" value="http://localhost/jfilescripts/formresp.asp">
<!-- The FileName# parameter specifies a file to transfer. To see your error page, enter an
invalid file name. -->
<PARAM name="FileName1" value="c:\invalidname.ext">
</APPLET>
http://localhost/jfilescripts/errorupload.htm
.When you assign a URL to the ErrorURL
parameter (as you do in errorupload.htm), JFile will add an error code
to the URL's query string. In our case, the ErrorURL with JFile's error code would be,
http://localhost/jfilescripts/errorpage.asp?jfile_errorcode=number
Errorpage.asp retrieves JFile's error code from the request's query string and displays an error message containing the code, as follows,
SoftArtisans JFile error <%=Request.QueryString("jfile_errorcode")%> occurred.
The following table lists JFile's error codes and their definitions.
Name | Value | Description |
---|---|---|
Cancel_Error | 100 | The user hit the cancel button or closed the status window during a transfer. |
General_Receive_Error | 200 | A failure occurred while receiving a response from the server. The connection with server may have been reset. |
General_Send_Error | 300 | Error occurred while sending the request to the server. The connection with the server may have been broken. There may be a malfunctioning proxy server preventing a large transfer. There may be insufficient privileges on the remote system. |
Https_Socket_Not_Supported_Error | 301 | SSL is currently not supported when using Sockets. |
File_Not_Found_Error | 302 | There are two possible causes: 1) the PostURL is invalid or doesn't exist, or 2) the local preset filename does not exist. |
Enable_Permissions_Error | 303 | This occurs only with Netscape 4.7x, if user has not been granted the required permissions. |
No_Files_To_Send_Error | 304 | No files are set to be uploaded to the server. This may occur if the value of AllowFiles or RestrictFiles is too restrictive. |
File_Verification_Error | 305 | The MD5 hash key generated by the DownloadClient does not match the key sent from the server. |
Version_Expired_Error | 400 | The trial version has expired. |
Resume_Init_Error | 500 | A file system error occured when preparing a resumed file transfer request. This is usually caused by insufficient access rights to JFile's temp directory for resumable uploads (JFileResumeDir). |
Successful_With_Download_Error | 501 | The download completed, but errors occurred during the HTTP download process. Some files were downloaded with errors. |
Successful_With_Move_Error | 502 | The HTTP transfer completed successfully but JFile was unable to save the file to the requested destination. This is usually caused by insufficient access rights or limited disk space. |
APPLET
tag adds JFile's UploadClient applet to your web page. We assigned values to several APPLET
attributes:Codebase
Codebase
is optional. When the Java class is in a different
directory, specify the complete relative path or URL.Code
Height
and Width
UseAppletInBrowser
to 1, as follows.
<PARAM name="UseAppletInBrowser" value=1>
If you do not set UseAppletInBrowser
to 1, that is, if you display the applet in a separate window, set
Height
and Width
to 0.Mayscript
Archive
Name
Name
. Use the
name you assign to reference the UploadClient applet in script.Cabbase
parameter specifies the cab file containing the Java applet. Filetransfer.cab contains JFile's Java
class files for Microsoft VM.ErrorURL
parameter contains the URL of a file to open when an error occurs. JFile will automatically
add an error code to the URL's query string. You can retrieve the error code to create an error message, as demonstrated in
errorpage.asp.PostURL
parameter specifies the URL to which the file will be posted, http://localhost/jfilescripts/formresp.asp.
Formresp.asp uses SoftArtisans FileUp to process the upload.FileNameN
parameter specifies a file to transfer. Enter an invalid file name to open the ErrorURL
page.Copyright © 2000-2003 SoftArtisans, Inc. All rights reserved.