There is a pretty good information here -

http://struts.apache.org/2.x/docs/file-upload.html

The internal details are relatively non-complex. The dispatcher hands
file uploads off to this class -

http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaMultiPartRequest.java?annotate=781501

If you're familiar with commons-fileupload, it's pretty straightforward.

As far as using the new plugin, it's in the sandbox right now, but
it's not much different than the original implementation, I just
changed some things up so that other implementations can be plugged in
(rather than taking the default FileItemFactory, etc.). Let me know
how it works for you.

-Wes

On Tue, Jul 14, 2009 at 6:39 AM, Daniele
Development-ML<daniele....@googlemail.com> wrote:
> Hello,
> my process in getting to this was 1. looking for some API to stream
> upload/download data directly into the HD, 2. found the Common File Upload
> API, 3. Went to the FAQ section to see how I could integrate in my Struts
> application ( http://commons.apache.org/fileupload/faq.html ), and read the
> last point - from which I assumed Struts doesn't use this modality.
>
> In addition, I didn't find any entry attached to Struts on the Web about
> this, and also I couldn't find any entry about configuration options on the
> upload/download modalities.
>
> Now, I'm a bit confused from your last message, Wes, is Dale right about
> multipart requests streamed into the HD directly?
>
> I'll use your plugin, and I'll report my experience once done.
>
> Thanks,
>
> Daniele
>
> On Mon, Jul 13, 2009 at 9:43 PM, Wes Wannemacher <w...@wantii.com> wrote:
>
>> On Mon, Jul 13, 2009 at 4:34 PM, Dale Newfield<d...@newfield.org> wrote:
>> >
>> >> I remember once I came across another possible solution, which allows
>> the
>> >> serialization of the file data as it is received from the server.
>> >
>> > I assume that the multipart request processor streams the content into a
>> > file without first loading the entire thing into memory...if you know
>> that
>> > this is not the case, please point out the offending portion of code...
>> >
>> > -Dale
>> >
>>
>> I am pretty sure you are right Dale, there was a JIRA that the choice
>> was unavailable. The GAE doesn't allow you to write files anywhere on
>> the filesystem, and there was no option to configure this behavior.
>> That's one of the reasons I started a plugin. The choices are
>> available in commons-fileupload, but we just weren't exposing them.
>> I'm guessing the files are getting serialized (I think the threshold
>> is way less than what he is talking about), he just didn't see them
>> anywhere.
>>
>> -Wes
>> --
>> Wes Wannemacher
>> Author - Struts 2 In Practice
>> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
>> http://www.manning.com/wannemacher
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>



-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

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

Reply via email to