|
JavaPowUpload 2.2
Tutorials |
Home
page Contact
support
|
JavaPowUpload tutorials
Data types
Here is the list of all data types used by JavaPowUpload:Include JavaPowUpload applet on a page
You can deploy applet on a page with 2 ways:<applet
code="com.elementit.JavaPowUpload.Manager"
archive="lib/JavaPowUpload.jar, lib/skinlf.jar,
lib/commons-httpclient.jar,
lib/commons-net-ftp.jar,
lib/commons-compress.jar"
width="600"
height="400"
name="JavaPowUpload"
id="JavaPowUpload"
mayscript="true"
alt="JavaPowUpload by www.element-it.com">
<!-- Java Plug-In Options -->
<param name="progressbar" value="true">
<param name="boxmessage" value="Loading JavaPowUpload Applet ...">
<!-- JavaPowUpload parameters -->
<param name="Common.SerialNumber" value="put your serial number here">
<param name="Common.UploadMode" value="true">
<param name="Upload.UploadUrl" value="FileProcessingScripts/ASP.NET/CSharp/uploadfiles.aspx">
<param name="Common.SkinLF.ThemepackURL" value="lib/themepack.zip">
Your browser does not support applets. Or you have disabled applets in your options.
To use this applet, please install the newest version of Sun's java.
You can get it from <a href="http://www.java.com/">java.com</a>
</applet>
<script src="Extra/deployJava.js"></script>
<script>
var attributes =
{
name : 'JavaPowUpload',
id : 'JavaPowUpload',
code : 'com.elementit.JavaPowUpload.Manager',
archive : 'lib/commons-httpclient.jar, lib/JavaPowUpload.jar',
width : 500,
height : 350,
mayscript : "true",
alt : "JavaPowUpload by www.element-it.com"
};
var parameters =
{
"Common.SerialNumber" : "put your serial number here",
"Common.UploadMode" : "true",
"Common.UseLiveConnect" : "true",
"Upload.UploadUrl" : "FileProcessingScripts/PHP/uploadfiles.php"
};
var version = '1.5.1' ;
deployJava.runApplet(attributes, parameters, version);
</script>
deployJava.runApplet(attributes, parameters, minimumVersion) - Ensures that an appropriate JRE is installed and then runs an applet. Configure JavaPowUpload using parameters
Parameters can be specified using 3 ways:
Example:
<param name="Common.UploadMode" value="true">
If you sue delpoyJava.js script to place applet on a page, the you should specify JavaPowUpload parameters at parameters javascript array.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<entry key="Common.UploadMode">true</entry>
<entry key="Common.BackgroundColor">#FFFFFF</entry>
<entry key="Common.UseLiveConnect">true</entry>
</properties>
Example:
JavaPowUpload.setParam("Upload.UploadUrl","http://localhost/JavaPowUpload/uploadfiles.php"); JavaScript communication
Here are several steps to start using the JavaPowUpload events and methods:To use the JavaPowUpload events, you should declare appropriate JavaScript functions. The function name format is Common.JavaScriptEventsPrefix+eventName. List of all available JavaPowUpload events is available in the events section.
Example:
function JavaPowUpload_onDownloadStart()
{
alert("Starting download process");
}
To use JavaPowUpload methods, you should init JavaPowUpload object.
Example:
//init JavaPowUpload JavaScript object
var JavaPowUpload;
JavaPowUpload = document.getElementById("JavaPowUpload");
//where "javaPowUpload" is id attribute of <applet> tag>
//Now we can use javaPowUpload methods, for example show browse dialog
JavaPowUpload.clickBrowse();
Download mode
JavaPowUpload can be used to download files from FTP/HTTP server. Here are the steps to configure the download mode:<?xml version="1.0" encoding="UTF-8"?>
<download>
<folder name="Folder">
<folder name="SubFolder">
<file name="image.jpeg" id="1" length="1240">
<url>SampleFiles/image.jpeg</url>
<thumbnailUrl>SampleFiles/thumbnail_image.jpeg</thumbnailUrl>
</file>
<file name="SimpleArchive.zip" id="2" length="488">
<url>SampleFiles/archive.zip</url>
</file>
</folder>
<file name="UncompressArchive.zip" id="3" length="488" uncompress="true" delete="true">
<url>SampleFiles/archive.zip</url>
</file>
</folder>
</download>
url - Files cannot have any children elements like file or folder, but they do have a source address.
The source URL of the file to download is specified via an url element.
The url element specifies an absolute URL to the file, but might also be relative to the codebase
URL. The codebase URL is the URL where the applet is loaded from.
If, for example, the JavaPowUpload component is installed to
http://www.example.com/downloads/JavaPowUpload.jar
the codebase URL is
http://www.example.com/downloads/
thumbnailUrl - If you would like to display images preview in thumbnails view when JavaPowUpload work download mode,
you can specify also thumbnailUrl element for file element. JavaPowUPload will download this file from server and display it in thumbnails view for that file.
<param name="Folder_0" value="Test folder">
<param name="File_0" value="image.jpeg">
<param name="File_0.url" value=SampleFiles/image.jpeg">
<param name="File_0.thumbnailUrl" value=SampleFiles/thumbnail_image.jpeg">
<param name="File_0.parent" value="Folder_0">
<param name="File_0.length" value="1240">
<param name="File_1" value="SampleArchive">
<param name="File_1.url" value="SampleFiles/archive.zip">
<param name="File_1.parent" value="Folder_0">
<param name="File_1.length" value="488">
<param name="File_1.uncompress" value="true">
<param name="File_1.delete" value="false”>
Upload modes, chunked upload mode.
To enable upload mode, set the value of the Common.UploadMode parameter to true (false by default) .Upload thumbnails
JavaPowUpload can generate image thumbails on the client side and upload them to a server. Supported image formats are JPEG, PNG, GIF. Here are the steps to configure the thumbnails upload feature:Compress before upload
JavaPowUpload can compress files into archive before upload. It may greatly decrease network traffic and upload time for some file types. Supported compression formats are ZIP, JAR, TAR, TAR-GZIP, TAR-BZIP2. Here are the steps to configure the compression before upload feature:Control JavaPowUpload using server response.
Starting from version 2.0.5, JavaPowUpload supports the execution of some commands received from a server in an http response.<JavaPowUpload> //display message with caption "Warning" message from tagHere is the description of all available tags (commands):
<message>Uploaded</message>
//set value of parameter
<param name="clearButtonVisible">false</param>
//display message with specified caption and message
<function name="showAlert" param1="warning" param2="error message"/>
//cancell upload
<callfunction name="cancelUpload"/>
</JavaPowUpload>
Internationalization of UI.
Starting from version 2.0.5, JavaPowUpload provides the feature to detect a user's language automatically and load a necessary file with the translation. This feature can be enabled/disabled using the Common.Language.AutoDetect parameter (false by deafult). If the parameter is set to true, JavaPowUpload will try to detect the user's language using the following JavaScript statement:(navigator.language) ? navigator.language : navigator.userLanguage. When the language is detected, the 2-letter language code will replace <LANGUAGE_CODE> placeholder in the Common.InternationalFile parameter. If the value of Common.InternationalFile parameter
does not contain
<LANGUAGE_CODE> placeholder, the language detection will not be performed. If the value of the Common.Language.AutoDetect parameter is set to false and
the value of the Common.InternationalFile parameter
contains <LANGUAGE_CODE> placeholder, the language detection will not be performed and the Common.InternationalFile parameter will be ignored.
Upload files directly to amazon S3
Starting from version 2.1 JavaPowUpload allow upload files directly to Amazon S3 servers.