JFile allows you to zip files before uploading them to the server, or extract files from a downloaded zip file.
Zipping files before transfer can increase the speed of a multi-file upload. However, as zipping the files takes time, it may not improve performance in the case of small transfers.
Use the ZipFiles parameter to zip files before upload. When ZipFiles is set to a value other than 0, JFile will zip the files to upload, and transfer a zip file to the server. Files may be either compressed in the zip or simply stored, depending on the value of the ZipMethod parameter.
ZipMethod takes one of two parameters:
While zipping files before an upload, JFile displays a status window. The window contains a message and a Cancel button. By default, the message displayed is Preparing Upload. To change the status message, set LabelZipStatus. Clicking the Cancel button aborts the transfer. To change the text on the Cancel button set LabelCancelButton.
If ZipMethod is set to "deflated," and a file is selected directly (rather than through a directory upload), it will be stored in the zip file with its original name, and without path information. If several files with the same name are added to the zip, "_(number)" will be appended to all but the first file name (for example, file.txt, file_(1).txt, file_(2).txt).
If ZipMethod is set to "stored," and a file is selected directly (rather than through a directory upload), it will be stored in the zip file with its original name and path information.
In the case of directory uploads (recursive or not), files will be added to the zip with their original names and relative paths. If several folders with the same name are added to the zip, "_(number)" will be appended to all but the first folder name (for example, a zip could contain folder\file.ext, folder_(1)\file.ext, and folder_(2)\file.ext).
<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 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. When uploading more than one file, use "FileName1," "FileName2," etc. --> <PARAM name="FileName1" value="c:\autoexec.bat"> <PARAM name="FileName1" value="c:\config.sys"> <!-- When ZipFiles is set to a value other than 0, JFile will zip the files to upload, and transfer a zip file to the server. --> <PARAM name="ZipFiles" value="1"> <!-- By default, the value of ZipMethod is "deflated" and files will be compressed in the zip. To store without compressing, set ZipMethod to "stored" as follows. <PARAM name="ZipMethod" value="stored"> --> <!-- To change the message displayed in the zip status window, set LabelZipStatus --> <param name="LabelZipStatus" value="Zipping Files"> <!-- The zip status window contains a Cancel button. Clicking this button aborts the transfer. To change the button's text set LabelZipCancelButton --> <param name="LabelZipCancelButton" value="Cancel Transfer"> </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.