Why are you saving the byte arrays in the page instance?

I show these files to  user with read-only permission  , so this user can
just view these files ,the owner of these files can delete them anytime , so
If I go to database     , upon user click , this file might have been
deleted by the user , or when user tries to access this file the   owner
might be deleting this file , to avoid such issues I am loading all the
bytes to page instance , so no  concurrent access issues .
to save them inside temp folders can I ask the page to give some identifier
which I can use  to name the folder which contains all the files ?  or do I
have to create my own identifier  ?


jthomerson wrote:
> 
> Why are you loading the files from the DB before the user asks for them
> (clicks the download link)?
> 
> Why are you saving the byte arrays in the page instance?  If you really
> must
> load them from the DB before the user clicks the download link, save them
> to
> a temp file and save only the path of the file in the page (like Igor
> originally said).
> 
> --
> Jeremy Thomerson
> http://www.wickettraining.com
> 
> 
> 
> On Mon, Oct 19, 2009 at 2:40 PM, fachhoch <fachh...@gmail.com> wrote:
> 
>>
>> I have several pages which has links to  uploaded files to download,  I
>> load
>> this from database and save it inside page instance as instance variable
>> .
>> When user clicks on the download link I retrieve the byte array from the
>> page instance and   call download.  Several user have  different
>> instances
>> of same pages and all these pages have these huge files byte[]  .
>> Sure this will cause Outof memory issues.
>> To resolve this  I have to  use temp folder ,
>> every time a page instance gets  created I have to   create temp folder
>> to
>> save these uploaded files bytes  with a proper name so that I can know
>> this
>> folder is for this  user and this page and this instance.   I am asking
>> do
>> I
>> have to create a naming factory which names the folder  for every page
>> instance ?  or is there anything available which  I can use a as  a
>> folder
>> name?
>>
>>
>>
>> fachhoch wrote:
>> >
>> > I show these files in almost all my pages.So every page  before it
>> loads
>> > has to create all these files in temp folder , please suggest me what
>> > should be the identifier   to recognize these files ,I actually have
>> these
>> > files inside PancelCachingTab  , and this tab gets loaded only when
>> user
>> > clicks on on it for the first time.
>> >
>> >
>> >
>> > igor.vaynberg wrote:
>> >>
>> >> store them in a temp directory and only give your page the filename.
>> >>
>> >> -igor
>> >>
>> >> On Mon, Oct 19, 2009 at 10:55 AM, tubin gen <fachh...@gmail.com>
>> wrote:
>> >>> I have   some huge files   upto 50Mb in side my page instance , I
>> have
>> >>> to
>> >>> save them in  page instance and I cannot reload it everytime from
>> >>> database
>> >>> becasue other users might delete the file .
>> >>>
>> >>> I am getting   java.lang.OutOfMemoryError  , only way I can resolve
>> this
>> >>> is
>> >>> increasing heap size but Is this a bad idea storing files upto 50Mb
>> >>> inside
>> >>> page instance ?
>> >>>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> For additional commands, e-mail: users-h...@wicket.apache.org
>> >>
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/uploaded-files-in-page-instance-tp25962716p25964309.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/uploaded-files-in-page-instance-tp25962716p25964541.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to