Parameters |
Description and sample |
Mandatory |
url |
Web server URL that will process the upload. It
could be the URL of JSP, PHP, CGI, CFM, ASP, ASP.NET...
server-side script.
For instance, http://www.mycompany.com/upload.jsp |
yes |
mode |
This parameter allows to select transport protocol.
For HTTP upload it must be "http". |
yes |
paramfile |
This parameter matches to input file HTML form
field needed for upload. Default is "uploadfile".
Check out server-side script to know if you need
to modify this parameter. |
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 whitelist="*.gif,*.jpg,*.jpeg". |
no |
blacklist |
This parameter allows to forbid filenames to upload (*.exe, *.zip,*.mp3 ...). For instance, to disallow end-user to upload microsoft executable files, use blacklist="*.exe". Note that if you use blacklist then you cannot use whitelist parameter. |
no |
policy |
This parameter allows to modify jfileupload
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 "false", "true", "crc", "md5". Default is false. An upload is considered broken if remote file already exists and remote file size < local file size. Additional control could be added :
"crc" : Check if remote file CRC checksum equals local file CRC.
"md5" : Check if remote file MD5 hash equals local file MD5.
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.
":shortname:" => Selected short name.
":extension:" => Selected extension.
":timestamp:" => Unix-like (epoch) timestamp.
":identifier:" => Auto increment integer starting at zero
or value defined by identifierinit parameter.
For instance,
template="test_:timestamp:_:name::extension:"
Value could be a regular expression followed by a string that will replace characters matching to the regular expression:
":regex=YourRegExpHere:ReplaceString:"
For instance, if you want to replace all non ASCII characters and punctuation by "_" then value of template will be:
":regex=[^a-zA-Z0-9_\\-\\.]:_:" If you need to apply template to folders in addition to files then add templatescope="path" parameter. |
no |
filechooserpattern |
This parameter adds a regular expression filter for file chooser. For instance, to filter filenames with ASCII characters only:
filechooserpattern="regex=[^a-zA-Z0-9_\\-\\.]" |
no |
overwritewarn |
This parameters allows displaying a pop-up that warns end-user about overwrite and allows overwrite/skip/cancel current transfer.
It compares remote and local file based on filename, filesize and optional checksum. Values could be:
"true" => Filename + filesize comparison.
"md5" => Additional MD5 hash.
"crc" => Additional CRC32. Notice that overwrite=true must be set. |
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.
Values could be :
"true" or "zip" => ZIP compression
"gzip" => GZIP compression.
".zip" or ".gz" extension will be appended
to uploaded filename. Default value is "false".
Learn more in FAQ.
For overall (one ZIP archive) compression, see tutorial.
|
no |
zipignorelist |
When ziponfly is enabled, this parameter allows to setup filenames to not zip. For instance, zipgnorelist="*.zip,*gif". |
no |
zipmaxsize |
This parameter allows to limit upload size (in bytes) of compressed file. For instance, to avoid end-user to send more than 1MB file, use zipmaxsize=1048576. Default zipmaxsize is -1. It means unlimited. |
no |
startdir |
This parameter allows to setup a local directory, instead of user's home, when using file browser (e.g. startdir="c:/tmp")
|
no |
authentication |
When authentication="auto", end-user will be prompted for credentials if needed. Default value is "disabled".
|
no |
username |
This parameter allows to pass www-authenticate username.
|
no |
password |
This parameter allows to pass www-authenticate password. |
no |
chunksize |
This parameter allows to split file in chunks before uploading. It is required for more than 2GB uploads. Default is -1, it means to not split file to upload. Server-side script that processes upload need to recompose file from chunks. We recommend JSPUpload with process.jsp script that provides this feature.
|
no |
chunkmode |
This parameter works with "chunksize" parameter above. If chunksize="onfly" then temporary chunks are not created on disk but in memory before uploading. chunkmode="onfly" isn't allowed when resume support is enabled. To support resume use chunkmode="onflyrange" (each chunk will be sent with Content-Range header). |
no |
encoding |
This parameter allows to modify request encoding.
Default is ISO-8859-1. |
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).
For instance, forward="http://yourserver.com/redirect.php"
|
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, jfileupload
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.
For instance, post="http://yourserver.com/process.php" |
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=..."
"extra" is same as long with filesize, last modified timestamp and extra parameters. See tutorial to learn more. |
no |
checksum |
This parameter allows to compute a file checksum before uploading and send it into an HTTP "checksum" header.
Values could be:
"md5" => MD5 hash computation.
"crc" => CRC32 computation. |
no |
retry |
This parameter allows to retry current upload when underlying socket fails (bad networks, connection timeout). For instance, to enable 3 retry attempts => retry="3" |
no |
retrydelay |
This parameter allows to setup delay in seconds between each retry attempts. Default is 2 seconds. |
no |
preferences |
Use preferences="true" to enable persistent preferences such as last directory opened. |
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 advanced 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 |
localeresources |
This advanced parameter allows to load resources based end-user locale/country code. Default is true. |
no |
verbosemode |
This advanced parameter allows enabling applet traces for debugging purposes:
"debug" => Debug traces are displayed in Java console.
|
no |