|
JavaPowUpload 2.1
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 the getFiles() method of an JavaPowUpload object.
isFile method
geId 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()
The method returns true if the item is a file; false - if it is a folder.
var isfile=JavaPowUpload.getFiles().get(0).isFile();
getId
String getId()
The method returns unique indentifier of a file.
var index=JavaPowUpload.getFiles().get(0).getId();
getIndex
long getIndex()
The method returns 0-based index of an item.
var index=JavaPowUpload.getFiles().get(0).getIndex(); // index of the first file in the list. The value should be 0.
isChecked
boolean isChecked()
The method returns true if the item is checked; otherwise false.
var checked=JavaPowUpload.getFiles().get(0).isChecked();
setChecked
void setChecked(boolean newValue)
The method checks or unckecks an item.
boolean newValue - True to set an item checked, false to uncheck an item.
JavaPowUpload.getFiles().get(0).setChecked(false);
getModificationDate
String getModificationDate()
The method returns the Date object that represents last modification date.
var modified=JavaPowUpload.getFiles().get(0).getModificationDate();
String getFilename()
The method returns only name of a file (without directories).
var fileName=JavaPowUpload.getFiles().get(0).getFileName();getPath
String getPath()
The method returns the path of the item in the tree without a file name.
var treePath=JavaPowUpload.getFiles().get(0).getPath();
getFullPath
String getFullPath()
The method returns the full path of the item (included file name).
var treeFullPath=JavaPowUpload.getFiles().get(0).getFullPath();
getLength
long getLength()
The method returns file size, in bytes.
var length=JavaPowUpload.getFiles().get(0).getLength();
getMD5Hash
String getMD5Hash()
The method returns string representation of file content MD5 hash.
var md5=JavaPowUpload.getFiles().get(0).getMD5Hash();
getFileSystemPath
String getFileSystemPath()
The method returns full path to a file on user's computer.
var userPath=JavaPowUpload.getFiles().get(0).getFileSystemPath();
getDescription
String getDescription()
The method returns a file description text.
var userPath=JavaPowUpload.getFiles().get(0).getDescription();
setDescription
void setDescription(String description)
The method sets file description text.
string description - New file description text.
JavaPowUpload.getFiles().get(0).setDescription("some text here");
getStatus
Integer getStatus()
The method returns file status constant.
var status=JavaPowUpload.getFiles().get(0).getStatus();
getRemoteFileName
String getRemoteFileName()
The method returns file name on remote FTP server. By default, the remote file name is not set (the method returns null), local file name is used.
var remoteName=JavaPowUpload.getFiles().get(0).getRemoteFileName();
setRemoteFileName
void setRemoteFileName(String rFileName)
The method sets file name on remote FTP server.
string rFileName - a file name that used to save the 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. It is similar to HTML "Name" parameter of the Form item.
value -�Value of text Form item. It is similar to HTML "Value" parameter of the Form item.
JavaPowUpload.getFiles().get(0).addPostField("Username","JDoe");
getPostField
void getPostField(String name)
Returns a value of the form field with the specified name.
name�- Name of a form field.
window.alert(JavaPowUpload.getFiles().get(0).getPostField("Username"));
removePostField
void removePostField(String name)
Removes a form field with the specified name.
name�- Name of a 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();