Servoy Large File Upload Issue

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Servoy Large File Upload Issue

Postby sambitc » Thu Feb 22, 2018 8:08 am

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 2344 times
sambitc
 
Posts: 6
Joined: Mon Jan 17, 2011 9:14 am

Re: Servoy Large File Upload Issue

Postby Gabi Boros » Thu Feb 22, 2018 10:19 am

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?
Gabi Boros
Servoy
Gabi Boros
 
Posts: 399
Joined: Tue Jun 26, 2007 4:03 pm
Location: Timisoara, Romania

Re: Servoy Large File Upload Issue

Postby 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.
sambitc
 
Posts: 6
Joined: Mon Jan 17, 2011 9:14 am

Re: Servoy Large File Upload Issue

Postby Gabi Boros » Thu Feb 22, 2018 3:31 pm

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/)
Gabi Boros
Servoy
Gabi Boros
 
Posts: 399
Joined: Tue Jun 26, 2007 4:03 pm
Location: Timisoara, Romania


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 8 guests