Transferring zip files can reduce network load and increase the speed of transfers. When downloading a zip file, JFile can be set to automatically extract the zipped files to a specified location on the client machine. To enable automatic zip extractions, set the parameter UnzipFiles to "1".
When UnzipFiles is enabled, a downloaded zip file will be extracted to the folder specified by the parameter FilenameN. Within this folder, if the zip file contains relative paths, JFile will create the necessary sub-directories, maintaining the original directory structure.
You can download multiple zip files to different directories by using multiple FilenameNs and URLNs.
Enabling UnzipFiles allows you to download both zip files and non-zip files.
If a file with the extension .zip is not a valid zip file, it will not be extracted or saved. When this occurs, JFile will send an error message to the Java Console, and proceed to download other specified files.
<APPLET codebase="/JFileScripts" code="softartisans.filetransfer.DownloadClient.class"
height="0" width="0" mayscript archive="filetransfer.jar" name="filedownload">
<!-- The Cabbase parameter specifies the cab file containing the download applet. -->
<PARAM name="cabbase" value="filetransfer.cab">
<!-- The FinalURL parameter specifies the URL to display when the download is complete. -->
<PARAM name="FinalURL" value="http://localhost/jfilescripts/confirm.asp">
<!-- Setting UnzipFiles to 1 enables the automatic exraction of a zip file after
it is downloaded. -->
<PARAM name="UnzipFiles" value="1">
<!-- The FileName# parameter specifies the local path to which to download and extract
the zip file. When downloading more than one file, use
"FileName1," "FileName2," etc. -->
<PARAM name="FileName1" value="c:\temp\sample.zip">
<!-- The URL# parameter specifies the URL of the file to download from the server.
When downloading more than one file, use "URL1," "URL2," etc.-->
<PARAM name="URL1" value="http://localhost/jfilescripts/sample.zip">
</APPLET>
<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.