by sambitc » Thu Feb 22, 2018 1:23 pm
-Thanks Gabi Boros for you hint. The issue was with heap memory since I am uploading large file, fixed this by increasing heap size.
- @Gabi Boros . Can we restrict file size in client side before streaming file to server, here is my code :
plugins.file.showFileOpenDialog(1, null , false, null ,callbackUpload, 'Select File');
function callbackUpload(event){
var fileSizeToUploadInBytes = arguments[0][0].size();
if(!scopes.globals.isFileSizeAllowedToUpload(fileSizeToUploadInBytes)){
// Warning dialog
globals.DIALOGS.showInfoDialog('Error','Can not upload file of size more than '
+ scopes.globals.getS3MaxFileSizeForTenantInMB() + " MB ", 'OK');
return false;
}
plugins.file.streamFilesToServer(arguments[0] , callBackUploadToServer);
}
- In "callbackUpload(event)" I am trying to restrict file size before uploading to server, it works but it seems like it first transfers file data to server then it check file size. Is it possible to check/restrict file size in client side which would be much faster operation.