"showFileOpenDialog" in Webclient

Hi

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 ?

Thanks

size: files[0].getData().length;

absolute path can’t be get, there is no absolute path only the name.

jcompagner:
size: files[0].getData().length;

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");
}
function cmn_showFileOpenDialog(selectionMode, startDirectory, multiselect, filterArray, callbackMethod, dialogTitle) {

	selectionMode = (selectionMode != null) ? selectionMode : 0;
	startDirectory = (startDirectory != null) ? startDirectory : null;
	multiselect = (multiselect != null) ? multiselect : false;
	filterArray = (filterArray != null) ? filterArray : null;
	callbackMethod = (callbackMethod != null) ? callbackMethod : null;
	dialogTitle = (dialogTitle != null) ? dialogTitle : null;

	var filePath = plugins.file.showFileOpenDialog(selectionMode, startDirectory, multiselect, filterArray, callbackMethod, dialogTitle);
return filePath;

if this works, how can i use the streamFilesToServer to send the file to the server?

 var filePath = plugins.file.showFileOpenDialog(selectionMode, startDirectory, multiselect, filterArray, callbackMethod, dialogTitle);
return filePath;

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.