Re: File size limit on uploads?

2003-06-20 Thread Chris Cooper
Any takers?

- Original Message - 
From: "Chris Cooper" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, June 19, 2003 6:07 PM
Subject: File size limit on uploads?


> Chaps,
>
> I have been having a number of problems with multipart/form-data uploads
of
> files, what I thought had been a problem with the sequence of events (see
my
> previous posts) now seems to be a problem of the size of file being
> uploaded.  I was convinced that at some point I had managed to upload a
70Mb
> file, I think it must have been wishful thinking on my part... :)
>
> The problem is as follows:
>
> 1. I GET a page that displays a form for uploading multiple files.
> 2. The user selects a file and POSTs the form using the submit button.
> 3. If the file seems to be >= 2Mb(ish) the Action receives no form
> parameters or attributes excluding the usual suspects (instances of
> org.apache.struts.action.MESSAGE,
org.apache.struts.action.mapping.instance
> and org.apache.struts.action.MODULE)
> 4. There appears to be no exception being thrown, certainly not on that is
> bubbling up into my code!
> 5. I do not have a maxFileSize set in web.xml
>
> Does anyone have any ideas?
>
> Chris.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



File size limit on uploads?

2003-06-19 Thread Chris Cooper
Chaps,

I have been having a number of problems with multipart/form-data uploads of
files, what I thought had been a problem with the sequence of events (see my
previous posts) now seems to be a problem of the size of file being
uploaded.  I was convinced that at some point I had managed to upload a 70Mb
file, I think it must have been wishful thinking on my part... :)

The problem is as follows:

1. I GET a page that displays a form for uploading multiple files.
2. The user selects a file and POSTs the form using the submit button.
3. If the file seems to be >= 2Mb(ish) the Action receives no form
parameters or attributes excluding the usual suspects (instances of
org.apache.struts.action.MESSAGE, org.apache.struts.action.mapping.instance
and org.apache.struts.action.MODULE)
4. There appears to be no exception being thrown, certainly not on that is
bubbling up into my code!
5. I do not have a maxFileSize set in web.xml

Does anyone have any ideas?

Chris.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Newbie Q: Missing parameters with multipart/form-data

2003-06-13 Thread Chris Cooper
Andrew,

Thanks for responding, answers are as follows:

> I havent really grokked what it is your doing here, but can share an
insight
> into multipart forms using struts that you probably already know and
> probably wont help you - but maybe you can relate it to your situation?

I'm basically producing a page with a form to upload 8 files at a time for
processing and upload into a DB.  The user navigates to a target folder
(with a folderId) in a previous page, and is then forwarded to this page.
After each upload (of one or more files) takes place, the user is forwarded
back to the same page to upload more files.  Essentially I'm writing a bulk
upload facility into an existing struts app.

> HttpServletRequest parameters for multipart forms as provided by the
servlet
> api only include those values that are part of the request uri - form
fields
> are not included. Obviously this makes life a little difficult so struts
(or
> rather the commons file-upload) kindly parses the request to extract the
> field values (and files) from whatever elwierdo format the browser
submitted
> them in and uses them to populate an object that 'wraps' the original
> request. This populating is done just prior to the actionform being
> populated (and only occurs if you have an action form!).

Thanks that clarified a few queries I had about the sequence of events.

> The wrapper is available throughout your action, however when you forward
> from the action is is 'unwrapped' so forwarding is done using the original
> request object (theres a bug in some 1.1 versions prior to b3 where this
> didnt happen) as some containers dont like to forward on the wrapper -
which
> doesnt extend HttpServletRequestWrapper in order to stay compatible with
> servlet api 2.2

The version of struts we are using is 1.0.2, which is the latest stable
release as far as I know, we have not upgraded here to the latest beta.
Although I'm not sure if that is inertia or for a reason.  It is however
interesting to know that there is a related bug that has been fixed.  Is is
possible to just swap the jar for the old version with the new?  Or are
there interface changes and/or deprecations that would have to be taken into
account?  Oh and I suppose most importantly is the new version stable? :)

> Now in your case, as far as I can see from what you are saying, you are
> repeating the *same* process 3 times, and the first two times it works,
and
> the third fails. What is different the third time? Can you explain the
> problem better?

The first time the page is generated from a GET, the second is the result of
the first POST and the third is the result of the second POST, as far as I
can tell the HTML generated from the GET and both POSTs are identical.  The
session is the same as is everything else apart from the files beiong
uploaded, which as I mentioned earlier are 500K, 1M and 2.1M in size.  I
don't think the file size is the problem as I have sucessfully uploaded
files of 70 to 80Mb.

> I can easily imagine something failing on the first or second try, but the
> third... strange!

Tell me about it! :)

> 
> This folderId parameter is added as a hidden input in the form on the
> generated page. (upload.do?folderId=n)
> 
> The "?folder=n" in the url is a url parameter thinghy not a hidden input -
> so that statement seems a bit contradictory. Which is it you are using. As
> explained above the difference can be significant for a multipart form.

Yeah on re-reading that does look a little confusing, what I meant was:
The initial request is in the guise of a URL encoded parameter
(upload.do?folderId=n), the HTML that is generated has the form with the
hidden input ()

> Since the aim is to upload multiple files (one at a time?) I presume you
are
> using a session scoped action form?

Unfortunately, a decision was made (long before I started working here) to
only use part of Struts, specifically Actions but not Forms (NO I HAVE NO
IDEA WHY!) so session scoped action forms are not being used.  The JSP uses
a number of taglibs to generate XML, with the outer-most taglib used to
apply XSLT to the resultant XML to generate HTML.  It would appear that
anything less than 4 levels of inderection here is regarded with derrision
and distain. (Or event the work of children) :)

Cheers,

Chris.

> -Original Message-
> From: Chris Cooper [mailto:[EMAIL PROTECTED]
> Sent: Friday, 13 June 2003 16:54
> To: Struts Users Mailing List
> Subject: Re: Newbie Q: Missing parameters with multipart/form-data
>
>
> No takers?
>
>
> > Hi guys,
> >
> > I've had a good look through the archives (and in fact pretty much the
> whole
> > of Usenet!) and I find several mentions of my problem similar to my own,
> but
> > no solutions.
> >
> > Please bear

Re: Newbie Q: Missing parameters with multipart/form-data

2003-06-13 Thread Chris Cooper
No takers?


> Hi guys,
>
> I've had a good look through the archives (and in fact pretty much the
whole
> of Usenet!) and I find several mentions of my problem similar to my own,
but
> no solutions.
>
> Please bear with me and read "parameter" as "parameter/attribute", I still
> haven't quite got the distinction concrete in my mind as yet!
>
> The problem is as follows:
>
> 1. I have a form for uploading multiple files, initially the user GETs the
> page with the form, the URL for this form has a URL encoded parameter for
a
> target folderId in my database.  This folderId parameter is added as a
> hidden input in the form on the generated page. (upload.do?folderId=n)
>
> 2. The user selects a number of files to upload using:
>
> 
> 
> etc...
> 
> Submit...
> 
>
> The user then hits the upload button to POST the form.
>
> 3. The UploadAction receives the POST request, processes each file and
sets
> the ForwardAction to the same page upload.do (my users may want to upload
> more files), the folderId is again added as a hidden input into the form,
> and the URL encoded parameter is now gone.
>
> 4. Step 2 happens again. Parameter folderId is still there in the form.
>
> 5. Step 3 happens again. Parameter folderId is still there attached to the
> request.
>
> 6. Step 2 happens again. Parameter folderId is *definitely* still there in
> the form, I have checked the HTML source!
>
> 7. Step 3 loses the plot, the getParameter("folderId") and
> getAttribute("folderId") both return null!  The parameter is no longer
> attached to the request nor are any of the file parameters present.
However
> the usual struts attributes are attached as expected.
>
> The form is very definitely being POSTed and the form definitely has the
> hidden input and the file inputs present, but at some point before my
> Action's performActionOnMultipartForm () method is being called, the
> parameters disappear into the Ether...
>
> I have reproduced this problem consistently, on reach occasion i upload
the
> same files (one each time) all three are JPEG images 500Kb, 1Mb and 2.1Mb
in
> size respectively, is the file size a problem?
>
> Frankly I am very confused, and would really appreciate any light that
> anyone can show on this, a solution would earn my undying gratitude :)
>
> Regards,
>
> Chris Cooper
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Newbie Q: Missing parameters with multipart/form-data

2003-06-12 Thread Chris Cooper
Hi guys,



I've had a good look through the archives (and in fact pretty much the whole
of Usenet!) and I find several mentions of my problem similar to my own, but
no solutions.



Please bear with me and read "parameter" as "parameter/attribute", I still
haven't quite got the distinction concrete in my mind as yet!



The problem is as follows:



1. I have a form for uploading multiple files, initially the user GETs the
page with the form, the URL for this form has a URL encoded parameter for a
target folderId in my database.  This folderId parameter is added as a
hidden input in the form on the generated page. (upload.do?folderId=n)

2. The user selects a number of files to upload using:





etc...



Submit...



The user then hits the upload button to POST the form.

3. The UploadAction receives the POST request, processes each file and sets
the ForwardAction to the same page upload.do (my users may want to upload
more files), the folderId is again added as a hidden input into the form,
and the URL encoded parameter is now gone.

4. Step 2 happens again. Parameter folderId is still there in the form.

5. Step 3 happens again. Parameter folderId is still there attached to the
request.

6. Step 2 happens again. Parameter folderId is *definitely* still there in
the form, I have checked the HTML source!

7. Step 3 loses the plot, the getParameter("folderId") and
getAttribute("folderId") both return null!  The parameter is no longer
attached to the request nor are any of the file parameters present.  However
the usual struts attributes are attached as expected.



The form is very definitely being POSTed and the form definitely has the
hidden input and the file inputs present, but at some point before my
Action's performActionOnMultipartForm () method is being called, the
parameters disappear into the Ether...



I have reproduced this problem consistently, on reach occasion i upload the
same files (one each time) all three are JPEG images 500Kb, 1Mb and 2.1Mb in
size respectively, is the file size a problem?



Frankly I am very confused, and would really appreciate any light that
anyone can show on this, a solution would earn my undying gratitude :)



Regards,



Chris Cooper

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]