JavaZOOM Web Site
  Software
  
Installation
  
HTTP Upload
  
FTP Upload
  
API & Design
<< back

- Configuration -

Here is the list and the meaning of all jClientUpload parameters for FTP upload. You will also find HTML sample for Applet and JNLP sample for WebStart .

  jClientUpload Parameters
Parameters Description and sample Mandatory
url FTP server URL that will process the upload.
For instance, ftp://ftp.mycompany.com
yes
mode This parameter allows to select transport protocol. For FTP upload it must be "ftp". yes
maxsize This parameter allows to limit upload size (in bytes). For instance, to avoid end-user to send more than 1MB file, use maxsize=1048576. Default maxsize is -1. It means unlimited upload size. Note that 1MB=1024*1024=1048576 bytes. no
maxfiles This parameter allows to limit number of files to upload. Default maxfiles is -1. It means unlimited files.
no
whitelist This parameter allows to filter filenames to upload (*.doc, *.exe,*.gif,*.pdf ...). For instance, to allow end-user to upload microsoft excel files only, use whitelist="*.xls". For both gif and jpeg use whilelist="*.gif,*.jpg,*.jpeg".
no
policy This parameter allows to modify jClientUpload behavior when a file to upload does not match to whitelist or maxsize. Default value is "abort", it means that upload won't proceed. "ignore" value means upload will proceed and unmatching files will be ignored.
no
folderdepth This parameter allows to set a max depth for directories and subdirectories uploads. Default is 0, it means to not recurse subdirectories. -1 means unlimited.
no
resume This parameter allows to resume broken uploads. Values could be "true" or "false". Default is false. An upload is considered broken if remote file already exists and size < local file size.
See FAQ to learn how it works.
no
overwrite This parameter allows to define overwrite policy for duplicate file on remote server. Values could be :
"true": Allow overwrite.
"false": Return an error message for duplicate uploads.
"indexrename": Rename duplicate upload such as file_1.zip, ...
"timerename": Rename duplicate upload such as file_mstime.zip
Default value is true. See FAQ to learn how it works.
no
hiddenfile This parameter allows to "accept" or "deny" hidden files for upload. Default value is "accept".
no
template This parameter allows to rename files to upload with a given template. Value could be any combination of :
":filename:" => Selected filename.
":name:" => Selected name.
":extension:" => Selected extension.
":timestamp:" => Unix-like (epoch) timestamp.
For instance, template="test_:timestamp:_:name::extension:"
no
ziponfly This parameter allows to zip file on-fly before uploading. It reduces bandwidth usage but it could affect client performance because of compression process. ".zip" extension will be appended to uploaded filename. Default value is "false". Learn more in FAQ.
no
forward This parameter allows to redirect to another URL once upload is completed. You could select the target frame through forwardtarget parameter (see below).
no
forwardtarget When forward parameter is enabled, this parameter allows to redirect URL to a given browser frame. Use _blank for new window.
no
forwardparameters When this parameter is set to true, jClientUpload appends uploaded filenames to redirect URL. For instance, "?filename1=foo1.txt&filename2=foo2.zip ..."
no
post This parameter allows to send HTTP POST request once upload is completed. See FAQ to learn how it works. no
postparameters This parameter allows to pass filenames uploaded in POST request above.
"true" means "filename1=foo1.txt&filename2=foo2.zip..."
"long" means "filename1=/home/usr1/foo1.txt&filename2=..."
no
timeout This advanced parameter allows to modify underlying socket timeout in milliseconds. no
socksproxyhost This advanced parameter allows to setup SOCKS proxy host.
no
socksproxyport This parameter allows to setup SOCKS proxy port. no
resources This advanced parameter allows to select a custom properties file including all resources (messages, errors, menu, items, colors) to be displayed. See internationalization section in FAQ to learn more. no
Extra
parameters
Description and sample Mandatory
paramX and valueX pair Additional parameters could be passed to FTP server through paramX, valueX (with X in [1,16]). For instance to pass anonymous login then use param1=username, value1=anonymous. See below for all supported extra parameters. no.
username This parameter allows to pass username when connecting to FTP server. no
password This parameter allows to pass password when connecting to FTP server. no
account This parameter allows to pass initial remote directory name when connecting to FTP server. For instance, param3=account and value3=dirname/subdir. Folder must be relative to FTP root folder. no
accountcreation Depending on account parameter above, this parameter allows to enable/disable initial remote directory creation on FTP server if it is not available. For instance, param4=accountcreation and value4=true. Default value is false. no
relativefilename When this parameter is set to true, jClientUpload will try to create folders and subfolders structure on FTP server when uploading directories. Default value is "false". Learn more in FAQ. no
pasv This parameter allows to enable/disable passive mode for FTP commands. To enable PASV mode then setup value to true. For instance, param4=pasv, value4=true. Default value is false. no
sitecommand This advanced parameter allows to pass a SITE ftp command after connection and authentication. no
deleteonfail This parameter allows to delete uncomplete file on FTP server when upload is cancelled or failed. Default value is "false". no
ftpsmode This advanced parameter allows to select FTPS explicit or implicit TLS/SSL connection mode. Value could be :
 auth_tls : AUTH TLS command is sent before SSL handshake.
 auth_ssl : AUTH SSL command is sent before SSL handshake.
 ssl_connect : Connection starts with a SSL handshake.
Default value is auth_tls when FTPS is enabled.
no
ftpsprot This advanced parameter allows to disable/enable channel protection on FTPS transfer. Values could be :
 prot_p : Protection channel enabled.
 prot_c : Protection channel not enabled.
Default value is prot_p when FTPS is enabled.
no
Front-end
parameters
Description and sample Mandatory
hidebar This parameter allows to enable or disable top menu bar with 'open file' and 'about' items. Default value is false. no
resetprogressbar This parameter allows to reset progress bar(s) when upload failed or is cancelled. Default value is false. no
colors and
others
resources

See internationalization section in FAQ to modify colors or resources (messages, errors, menu items, fonts, image) in your custom i18n.properties file.

no

  jClientUpload Applet - HTML sample
Below the HTML script you need to copy/paste in your HTML source to use jClientUpload applet. Setup parameters (according to table above) in blue. Notices that all parameters need to be setup twice (it allows cross-browsers support).

<!-- jClientUpload Applet : Begin copy/paste -->
<SCRIPT LANGUAGE="JavaScript"><!--
var _info = navigator.userAgent;
var _ns = false;
var _ns6 = false;
var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0);
//--></SCRIPT>
<COMMENT>
<SCRIPT LANGUAGE="JavaScript1.1"><!--
var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0) || (_info.indexOf("AIX") > 0) || (_info.indexOf("OS/2") > 0) || (_info.indexOf("IRIX") > 0)));
var _ns6 = ((_ns == true) && (_info.indexOf("Mozilla/5") >= 0));
//--></SCRIPT>
</COMMENT>
<SCRIPT LANGUAGE="JavaScript"><!--
if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "250" HEIGHT = "250" NAME = "clientupload" codebase="http://java.sun.com/update/1.4.2/jinstall-1_4-windows-i586.cab#Version=1,4,0,0"><NOEMBED><XMP>');
else if (_ns == true && _ns6 == false) document.writeln('<EMBED \
type="application/x-java-applet;version=1.4" \
CODE = "javazoom.upload.client.MApplet.class" \
JAVA_CODEBASE = "./" \
ARCHIVE = "lib/jclientupload.jar,lib/ftpimpl.jar,lib/cnet.jar,lib/clogging.jar" \
NAME = "clientupload" \
WIDTH = "250" \
HEIGHT = "250" \
url ="ftp://localhost" \
param1 ="username" \
value1 ="anonymous" \
param2 ="password" \
value2 ="something@somewhere.com" \
mode ="ftp" \

scriptable=false \
pluginspage="http://java.sun.com/products/plugin/index.html#download"><NOEMBED><XMP>');
//--></SCRIPT>
<APPLET CODE = "javazoom.upload.client.MApplet.class" JAVA_CODEBASE = "./" ARCHIVE = "lib/jclientupload.jar,lib/ftpimpl.jar,lib/cnet.jar,lib/clogging.jar" WIDTH = "250" HEIGHT = "250" NAME = "clientupload"></XMP>
<PARAM NAME = CODE VALUE = "javazoom.upload.client.MApplet.class" >
<PARAM NAME = CODEBASE VALUE = "./" >
<PARAM NAME = ARCHIVE VALUE = "lib/jclientupload.jar,lib/ftpimpl.jar,lib/cnet.jar,lib/clogging.jar" >
<PARAM NAME = NAME VALUE = "clientupload" >
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.4">
<PARAM NAME="scriptable" VALUE="false">
<PARAM NAME = "url" VALUE="ftp://localhost">
<PARAM NAME = "param1" VALUE="username">
<PARAM NAME = "value1" VALUE="anonymous">
<PARAM NAME = "param2" VALUE="password">
<PARAM NAME = "value2" VALUE="something@somewhere.com">
<PARAM NAME = "mode" VALUE="ftp">

</APPLET>
</NOEMBED>
</EMBED>
</OBJECT>
<!-- jClientUpload Applet : End copy/paste -->

  jClientUpload WebStart - JNLP sample
Below the JNLP file you need to use for jClientUpload WebStart. Setup parameters (according to table above) in blue. You do need to modify codebase parameter according to your server URL.

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://localhost:8080/uploadbean/" href="webstart_ftp.jnlp">
<information>
<title>jClientUpload</title>
<vendor>JavaZOOM</vendor>
<homepage href="http://www.javazoom.net"/>
<description>This Java application allows to upload files to a HTTP or FTP server.
</description>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.4 1.5 1.3"/>
<jar href="lib/jclientupload.jar" main="true" download="eager"/>
<jar href="lib/ftpimpl.jar"/>
<jar href="lib/cnet.jar"/>
<jar href="lib/clogging.jar"/>
</resources>
<application-desc main-class="javazoom.upload.client.MApplication">
<argument>-url</argument>
<argument>ftp://localhost</argument>
<argument>-mode</argument>
<argument>ftp</argument>
<argument>-param1</argument>
<argument>username</argument>
<argument>-value1</argument>
<argument>anonymous</argument>
<argument>-param2</argument>
<argument>password</argument>
<argument>-value2</argument>
<argument>something@somewhere.com</argument>

</application-desc>
</jnlp>

[News] [Applets] [Servlets] [Services] [Projects] [Links] [About]

Copyright © JavaZOOM 1999-2005

Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U. S. and other countries.
All other company and/or product names are the property of their respective owners.