Page 1 of 1

Servoy Large File Upload Issue

PostPosted: Thu Feb 22, 2018 8:08 am
by sambitc
Hi All,
My servoy version is "Servoy version 7.4.5 -releaseNumber 2041".

- I am uploading file using [ plugins.file.showFileOpenDialog(1, null , false, null ,callbackUpload , 'Select File') ] in web client which works fine while uploading file of size nearly 150MB, but the call back function("callbackUpload ") is not being called while uploading file of size >250MB and I am getting this error on select file window.

Can you please help me with this.

Thanks in advance.
InternalError.png
InternalError.png (12.71 KiB) Viewed 2383 times

Re: Servoy Large File Upload Issue

PostPosted: Thu Feb 22, 2018 10:19 am
by Gabi Boros
if you check the servoy log file, do you see out of memory error? can it be that you try to read the uploaded file bytes into the memory?
how does you callbackUpload look like?

Re: Servoy Large File Upload Issue

PostPosted: Thu Feb 22, 2018 1:23 pm
by sambitc
-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.

Re: Servoy Large File Upload Issue

PostPosted: Thu Feb 22, 2018 3:31 pm
by Gabi Boros
there is no way to validate the size on the client side now, but you may create a feature request case for this (https://support.servoy.com/)