1 Reply Latest reply on Apr 23, 2007 1:50 PM by Christian Bauer

    Wiki question: File to db with minimal memory

    Stuart Robertson Novice

      The wiki source (which btw I've found the wiki app source to be tremendously useful - thanks for doing this in the open) for FileHome.java has the following comment:

       // TODO: This should really use an InputStream and directly stream into the BLOB without consuming server memory
       private byte[] filedata;
      


      I've put off dealing efficiently with uploaded file data, and would like to lock this down as well.

      The two parts I see are 1) having file upload write directly to a tmp file, and never keeping a naked byte [] in memory, and 2) implementing what the above comment refers to.

      I can figure out #1 from Seam source (MultipartRequest seems pretty clear). Does anyone have any pointers for #2?