|
JavaPowUpload 2.0
JavaPowUpload.UploadItem object |
Home
page Contact
support
|
UploadItem object methods
UploadItem object provides a way to access individual files added to list. You cannot create an UploadItem object directly. You should obtain it by getFiles() method of an JavaPowUpload object.
isFile method
getIndex method
isChecked method
setChecked method
getModificationDate method
getFilename method
getPath method
getFullPath method
getLength method
getMD5Hash method
getFileSystemPath method
getDescription method
setDescription method
getStatus method
getRemoteFileName method
setRemoteFileName method
addPostField method
getPostField method
removePostField method
clearPostFields method
isFile
boolean isFile()
Method returns true if item is file; false is folder.
var isfile=JavaPowUpload.getFiles().get(0).isFile();
getIndex
long getIndex()
Method returns 0-based index of item.
var index=JavaPowUpload.getFiles().get(0).getIndex(); // index of first file at the list. Value should be 0.
isChecked
boolean isChecked()
Method returns true if item is checked; otherwise false.
var checked=JavaPowUpload.getFiles().get(0).isChecked();
setChecked
void setChecked(boolean newValue)
Method checks or unckecks item.
boolean newValue - True to set item checked, false to uncheck item.
JavaPowUpload.getFiles().get(0).setChecked(false);
getModificationDate
String getModificationDate()
Method returns Date object that represents last modification date.
var modified=JavaPowUpload.getFiles().get(0).getModificationDate();
String getFilename()
Method returns only name of file (without directories).
var fileName=JavaPowUpload.getFiles().get(0).getFileName();getPath
String getPath()
Method returns the path of the item in tree without file name.
var treePath=JavaPowUpload.getFiles().get(0).getPath();
getFullPath
String getFullPath()
Method returns the full path of the item (included file name).
var treeFullPath=JavaPowUpload.getFiles().get(0).getFullPath();
getLength
long getLength()
Method returns file size, in bytes.
var length=JavaPowUpload.getFiles().get(0).getLength();
getMD5Hash
String getMD5Hash()
Method returns string representation of file content MD5 hash.
var md5=JavaPowUpload.getFiles().get(0).getMD5Hash();
getFileSystemPath
String getFileSystemPath()
Method returns full path to file on user computer.
var userPath=JavaPowUpload.getFiles().get(0).getFileSystemPath();
getDescription
String getDescription()
Method returns file description text.
var userPath=JavaPowUpload.getFiles().get(0).getDescription();
setDescription
void setDescription(String description)
Method sets file description text.
string description - New file description text .
JavaPowUpload.getFiles().get(0).setDescription("some text here");
getStatus
Integer getStatus()
Method returns file status constant.
Available values:var status=JavaPowUpload.getFiles().get(0).getStatus();
getRemoteFileName
String getRemoteFileName()
Method returns file name on remote FTP server. By default remote file name not set (method return null), local file name used.
var remoteName=JavaPowUpload.getFiles().get(0).getRemoteFileName();
setRemoteFileName
void setRemoteFileName(String rFileName)
Method sets file name on remote FTP server.
string rFileName - File name that used to save file on remote FTP server.
JavaPowUpload.getFiles().get(0).setRemoteFileName("new_file_name.ext");
addPostField
void addPostField(String name, String value)
Adds name–value pair to the list that will be sent as text Form items with this file.
name - Name of text Form item. This similar to HTML "Name" parameter of Form item.
value - Value of text Form item. This similar to HTML "Value" parameter of Form item.
JavaPowUpload.getFiles().get(0).addPostField("Username","JDoe");
getPostField
void getPostField(String name)
Return value of form field with specified name.
name - Name of form field.
window.alert(JavaPowUpload.getFiles().get(0).getPostField("Username"));
removePostField
void removePostField(String name)
Remove form field with specified name.
name - Name of form field.
window.alert(JavaPowUpload.getFiles().get(0).getPostField("Username"));
clearPostFields
void clearPostFields()
Removes all text Form items added before.
JavaPowUpload.getFiles().get(0).clearPostFields();