To use JftpApplet just copy the Jftp.jar file to a directory on your web server and specify the location in the <APPLET>
tag's CODEBASE
param.
<APPLET name="jftp" ... CODEBASE="jftp_dir" archive="jftp.jar" code="com.somethingjava.JftpApplet"> ... </APPLET>
The CODE
parameter value for the shareware version is "com.somethingjava.shareware.JftpApplet".
Unfortunately, the <APPLET>
tag does not work in all browsers, neither do <OBJECT>
and <EMBED>
. If you want a single page to work in all browsers across all platforms, the only solution seems to be a browser-detection script that dynamically creates the <APPLET>
or <OBJECT>
/<EMBED>
tags. It can be server-side (ASP, JSP, PHP, CGI etc) or client-side (JavaScript). We have an example on our site (!!!!URL!!!!) that works on most browser/OS combinations, however, we do not guarantee it will work on ALL.
A good source of information on the subject is Sun Microsystem's site (!!!!URL!!!!).
Note: The Jftp.jar is digitally signed to provide access to a clients local file system. Do not modify the jar file.... ... ...
bgColor
- the background color, a 6-digit hexadecimal (as in HTML)
progressBarColor
- the color of the progress bar, a 6-digit hexadecimal (as in HTML)
textColor
- the color of the status text and file name, a 6-digit hexadecimal (as in HTML)
width
- width of the applet
height
- height of the applet. We recommend about 120 with buttons shown, 85 without.
showButtons
- if "true
" displays "Browse", "Send", "Abort" buttons within the applet.
We prefer using HTML for the buttons because they can be easily modified with stylesheets to fit in your site's design. We also prefer the the file selection dialog that an <input type="file">
opens in Windows. However, no browser on Mac OS (9 or X) supports interaction between JavaScript and applets.
One solution to use the applet on a Mac is to set showButtons to true.
The Mac buttons look great anyway.
host
- domain name of IP address of FTP server. DO NOT put "ftp://
" at the beginning
port
- FTP port number (21 by default). Cannot be changed in the Shareware version.
userName
- login. Required.
pass
- password. Required.
passive
- when "true
" JftpApplet will use passive mode to transfer files.
clientPath
-
clientFile
- file to upload. Required.
serverPath
- directory on the ftp server to save the file to. If blank, file(s) will be stored in FTP server's default directory. If specified, directory must already exist and you must have write permissions. Note that depending on your FTP server settings, absolute paths (starting with "/
") may be treated differently. For example, "/somedir
" could be interpreted as subdirectory of the file system root, of the FTP root, or of the user's FTP directory. Or even something else.
serverFile
- file name to store uploaded file as. If blank, it will be stored as specified by clientFile
.
clientPath
-
clientFile
- file name to save downloaded file as. If blank, same as specified by serverFile
.
serverPath
- directory on the ftp server where file is located. If blank, FTP server's default directory. See note under Upload.
serverFile
- file to download. Required.
successUrl
- URL to jump to on successful completion of transfer. On most platforms you can also use a "javascript:
" URL to call a JavaScript function in your page.
successTarget
- Target window for the successUrl
. Default is "_self
". Valid values are same as for <A TARGET="">
HTML atttribute. Not available in Shareware version.
interactive
-
autoSend
-
configFile
-
The following parameters may be set this way: host
, port
, userName
, pass
, serverPath
Note: Parameters set in this manner take precedence over parameters in the HTML file.
setBgColor(color)
- sets the background to the specified color, a 6-digit hexadecimal string (as in HTML)setProgressBarColor(color)
- sets th progress bar to the specified color, a 6-digit hexadecimal string (as in HTML)setTextColor(color)
- sets the status text and file name to the specified color, a 6-digit hexadecimal string (as in HTML)setShowButtons(showButtons)
- shows or hides the "Browse", "Send", "Abort" buttons in the applet window. Note that buttons may not be visible if height
is set too low.Note that width
and height
can only be set as parameters and cannot be changed once page is loaded.
setHost(host)
- domain name of IP address of FTP server. DO NOT put "ftp://
" at the beginning
setPort(port)
- FTP port number (21 by default). Cannot be changed in the Shareware version.
setUserName(userName)
- login. Required.
setPass(pass)
- password. Required.
setPassive(passive)
- when "true
" JftpApplet will use passive mode to transfer files.
setClientPath(clientPath)
-
setClientFile(clientFile)
- file to upload. Required.
setServerPath(serverPath)
- directory on the ftp server to save the file to. If blank, file(s) will be stored in FTP server's default directory. If specified, directory must already exist and you must have write permissions. Note that depending on your FTP server settings, absolute paths (starting with "/
") may be treated differently. For example, "/somedir
" could be interpreted as subdirectory of the file system root, of the FTP root, or of the user's FTP directory. Or even something else.
setServerFile(serverFile)
- file name to store uploaded file as. If blank, it will be stored as specified by clientFile
.addUpload()
- Adds a file to the Upload queue using current values of clientPath
, clientFile
, serverPath
and serverFile
.addUpload(clientPath, clientFile, serverPath, serverFile)
- Adds a file to the Upload queue with specified paths and names.addUpload(clientFile)
- Adds clientFile to Upload queue using defaults for the rest of the parameters.addUpload(clientFile, serverFile)
- Adds clientFile to Upload queue to be saved as serverFile on the FTP server.addUploadDir(clientPath)
- Adds all files in clientPath directory to the Upload queue. Does not look in subdirectories in this version.addUploadDir(clientPath, serverPath)
- startUpload()
- sends all files in Upload queue.sendFile()
- sends the file specified by current values of clientPath
, clientFile
, serverPath
and serverFile
.NOTE: sendFile()
is there for compatibility with previous version. It will clear the Upload queue before sending. Use with care.
abort()
- aborts the upload. Current transfer remains in the queue.setClientPath
-
setClientFile
- file name to save downloaded file as. If blank, same as specified by serverFile
.
setServerPath
- directory on the ftp server where file is located. If blank, FTP server's default directory. See note under Upload.
setServerFile
- file to download. Required.
addDownload(clientPath, clientFile, serverPath, serverFile)
-
addDownload(clientFile, serverFile)
-
addDownload(serverFile)
-
setSuccessUrl(url)
- URL to jump to on successful completion of transfer. On most platforms you can also use a "javascript:
" URL to call a JavaScript function in your page.
setSuccessTarget(target)
- Target window for the successUrl
. Default is "_self
". Valid values are same as for <A TARGET="">
HTML atttribute. Not available in Shareware version.
setAutoSend(on)
- getStatus()
- setInteractive(on)
- uploads()
- Returns the contents of the Upload queue as a string where each upload is separated by listFileSeparator
and fields within uploads are separated by listFieldSeparator
. For each file, the following fields are returned: clientPath, clientFile, serverPath, serverFile, length and successUrl in this order.getListFieldSeparator()
- Returns the value of the field separator. Default is "<
".getListFileSeparator()
- Returns the value of the file separator. Default is "><
".setListFieldSeparator(str)
- Sets the value of listFieldSeparator
to the specified string. setListFileSeparator(str)
- Sets the value of listFileSeparator
to the specified string. Note: The default field and file separators were chosen because they are not valid characters in a path or file name. A sample JavaScript function to parse the list returned by uploads()
is provided on our website.