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>
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, 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. |
<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.