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>
http://localhost/jfilescripts/zipdownload.htm
. Click "Download."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.FinalURL
parameter specifies the URL to display when the download is complete.
Confirm.asp is a download confirmation page.UnzipFiles
parameter to "1" enables automatic extraction of
zip files after download.FileNameN
parameter specifies the local path to which to download
and extract the zip file. When downloading more than one file, use "FileName1," "FileName2," etc.URLN
parameter specifies the URL from which to download the file.
When downloading more than one file, use "URL1," "URL2," etc.Copyright © 2000-2003 SoftArtisans, Inc. All rights reserved.