I am using a callback method for showFileOpenDialog. It has a parameter “files”.
Everything working fine as expectation in smart client. I can get the file size, absolute path, file names, etc in smart client.
But the behavior is different in web client.
files[0] is returning “UploadData[name:Winter.jpg,contenttype:image/jpeg]” .
plugins.file.getFileSize(files[0]) is returning -1
files[0].getAbsolutePath() is returning null
So how to get the file size, absolute path in webclient ?
absolute path can’t be get, there is no absolute path only the name.
what is the callbackfunction?
function selectRestoreFile() {
var selectedFile = globals.cmn_showFileOpenDialog(1, null, false, new Array("ZIP file", "zip"), selectRestoreFile, "Open file to restore");
}
that doesn’t work for the web. the web will return null there so filePath will be nothing, and besides that it won’t be the filePath (as a string) it will be a JSFile object in the smart client anyway.
But your callback method which is just a function will get an array of JSFile objects, there you can get the name and the bytes from.