You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by uud ashr <uu...@gmail.com> on 2009/07/10 10:49:35 UTC

Re: File upload without writing to temp file (on Google App Engine)

I've been thinking to change the implementation.No more write to temp file,
but write to datastore.

We can use this as standard way to store file on google app engine.

I wonder, is there anyone who create something like this?
Regards,
uudashr

On Mon, Jun 22, 2009 at 4:07 PM, Dolejs Vlastimil <st...@atlas.cz> wrote:

> Hi,
> I know, how to store data, but I dont know, how to upload it without
> writing to file and spawning new threads..
>
> >---------------------------------------------------------
> >Od: Adrian Merrall
> >Přijato: 21.6.2009 9:35:25
> >Předmět: Re: File upload without writing to temp file (on Google App
> Engine)
> >
> >On Sun, Jun 21, 2009 at 7:18 AM, Joe Fawzy <jo...@gmail.com> wrote:
> >
> >
> >
> >> Hi split it into small chunks and store each as a blob in datastore
> entity
> >
> >> Joe
> >
> >>
> >
> >> On Sat, Jun 20, 2009 at 1:44 PM, Dolejs Vlastimil <st...@atlas.cz>
> >
> >> wrote:
> >
> >>
> >
> >> > Hi,
> >
> >> > I´m trying write wicket application for Google App Engine.
> >
> >> > App Engine has some restrictions, one of them is, that you can´t work
> >
> >> with
> >
> >> > filesystem.
> >
> >> > I´m trying upload images with FileUploadField, but i get
> >
> >> > AccessControlException.
> >
> >> > Looking through source code i found there is DiskFileItemFactory,
> which
> >
> >> > puts large files (over 10kB) to temp files.
> >
> >> > Is there any way to redirect all data storing to memory?
> >
> >> >
> >
> >> > I also found, if I upload small file (smaller than 10kB) -
> >
> >> > DiskFileItemFactory store it in memory, but there is some FileCleaner
> >
> >> class
> >
> >> > which cleans temp files and spawns new Thread (which is also
> restricted
> >
> >> in
> >
> >> > App Engine). So it fails again on AccessControlException.
> >
> >> >
> >
> >> > Have you anybody solved problems with file uploads on App Engine?
> >
> >> >
> >
> >> > Thanks
> >
> >>
> >
> >
>

Re: File upload without writing to temp file (on Google App Engine)

Posted by uud ashr <uu...@gmail.com>.
Done,
I've just implement my idea.
I change the some implementation, actually the main problem is on
DiskFileItem, but I need to change several classes too.
No more writing file to disk, but write as Entity, big file chunk into
several entities.
Original FileCleaner will launch daemon thread, but I use simple loop to
clean up the unreachable PhantomReference on every request.

Regards,
uudashr

2009/7/10 uud ashr <uu...@gmail.com>

> I've been thinking to change the implementation.No more write to temp
> file, but write to datastore.
>
> We can use this as standard way to store file on google app engine.
>
> I wonder, is there anyone who create something like this?
> Regards,
> uudashr
>
> On Mon, Jun 22, 2009 at 4:07 PM, Dolejs Vlastimil <st...@atlas.cz>wrote:
>
>> Hi,
>> I know, how to store data, but I dont know, how to upload it without
>> writing to file and spawning new threads..
>>
>> >---------------------------------------------------------
>> >Od: Adrian Merrall
>> >Přijato: 21.6.2009 9:35:25
>> >Předmět: Re: File upload without writing to temp file (on Google App
>> Engine)
>> >
>> >On Sun, Jun 21, 2009 at 7:18 AM, Joe Fawzy <jo...@gmail.com> wrote:
>> >
>> >
>> >
>> >> Hi split it into small chunks and store each as a blob in datastore
>> entity
>> >
>> >> Joe
>> >
>> >>
>> >
>> >> On Sat, Jun 20, 2009 at 1:44 PM, Dolejs Vlastimil <st...@atlas.cz>
>> >
>> >> wrote:
>> >
>> >>
>> >
>> >> > Hi,
>> >
>> >> > I´m trying write wicket application for Google App Engine.
>> >
>> >> > App Engine has some restrictions, one of them is, that you can´t work
>> >
>> >> with
>> >
>> >> > filesystem.
>> >
>> >> > I´m trying upload images with FileUploadField, but i get
>> >
>> >> > AccessControlException.
>> >
>> >> > Looking through source code i found there is DiskFileItemFactory,
>> which
>> >
>> >> > puts large files (over 10kB) to temp files.
>> >
>> >> > Is there any way to redirect all data storing to memory?
>> >
>> >> >
>> >
>> >> > I also found, if I upload small file (smaller than 10kB) -
>> >
>> >> > DiskFileItemFactory store it in memory, but there is some FileCleaner
>> >
>> >> class
>> >
>> >> > which cleans temp files and spawns new Thread (which is also
>> restricted
>> >
>> >> in
>> >
>> >> > App Engine). So it fails again on AccessControlException.
>> >
>> >> >
>> >
>> >> > Have you anybody solved problems with file uploads on App Engine?
>> >
>> >> >
>> >
>> >> > Thanks
>> >
>> >>
>> >
>> >
>>
>
>