xiaochong / zkui

Grails ZK UI Plugin
http://grails.org/plugin/zkui
GNU Lesser General Public License v3.0
24 stars 8 forks source link

How to handle big / large file upload? #125

Open franky04 opened 10 years ago

franky04 commented 10 years ago

Hi all / Xiaochong,

I was wondering if you have a solution for handling big file upload (let's say 50mb, but it could also be a couple gigabytes...)?

I am running Grails 2.0.x and and ZKUI 0.5.4 if my memory serves. I am using MVVM all over the place, and we are already able to manage file upload and file download, but since default file upload solution put the byte array representation of files being transferred into memory, server will eventually crash an out of memory exception if file is just too large.

1- What I am looking for is a solution for MVVM that, for uploads, uses the file's byte stream to saves the the file content directly on disk (through the use of a customizable - in size - buffer). This way, no matter how big the file is, there would never be an out-of-memory issue since we are not reading the 'whole' file into memory, just a piece of it for each read cycle (the buffer size).

2- (optional, but very nice to have for end users uploading large files) How would you plug a progress bar to this while uploading?

Thank you for any help, Frank