RE: Can't multipart post large(ish) files via Tomcat 5.0.28

2005-04-19 Thread Gareth Williams
Using commons-fileupload results in the same problem.  I looked at the
source, and the commons class FileUploadBase gets its input stream from
the HttpServletRequest (as you would expect :) and hence I get the same
errors/problematic behaviour.  Whatever is going wrong would appear to
be either within Tomcat or within the underlying windows socket tcp/ip
stuff 

I am surprised nobody else seems to have hit this upload problem given
the number of people using Tomcat5.0.28 + Jboss 3.2.6.  Has anyone got
any ideas?

Cheers, Gareth

#
Winner - e-Government excellence 2004. 
Runner up - European Information Management awards 2004:
- The Premier Project Award. 
- B2C Commerce Project Award. 
- CRM Project Award. 

For more information visit us at www.voxgen.com

#
Note:
This message is for the named person's use only.  It may contain confidential,
proprietary or legally privileged information.  No confidentiality or privilege
is waived or lost by any mistransmission.  If you receive this message in error,
please immediately delete it and all copies of it from your system, destroy any
hard copies of it and notify the sender.  You must not, directly or indirectly,
use, disclose, distribute, print, or copy any part of this message if you are 
not
the intended recipient. Vox Generation Limited and any of its subsidiaries each 
reserve the right to monitor all e-mail communications through its networks.

Any views expressed in this message are those of the individual sender, except 
where
the message states otherwise and the sender is authorised to state them to be 
the
views of any such entity.

Thank You.
#

#
This e-mail message has been scanned for Viruses and Content and cleared 
by NetIQ MailMarshal
#

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



RE: Can't multipart post large(ish) files via Tomcat 5.0.28

2005-04-19 Thread Derrick Koes

Are you using struts?

Make sure your controller element tempDir property value matches that of the 
web apps context element's workDir.  The workDir is where uploaded files over a 
certain size (256KB is the default I think) will be written prior to their 
final destination.  Perhaps Jboss has a working directory that needs to match 
as well.  H.


-Original Message-
From: Gareth Williams [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 19, 2005 7:31 AM
To: Tomcat Users List
Subject: RE: Can't multipart post large(ish) files via Tomcat 5.0.28

Using commons-fileupload results in the same problem.  I looked at the source, 
and the commons class FileUploadBase gets its input stream from the 
HttpServletRequest (as you would expect :) and hence I get the same 
errors/problematic behaviour.  Whatever is going wrong would appear to be 
either within Tomcat or within the underlying windows socket tcp/ip stuff 

I am surprised nobody else seems to have hit this upload problem given the 
number of people using Tomcat5.0.28 + Jboss 3.2.6.  Has anyone got any ideas?

Cheers, Gareth

#
Winner - e-Government excellence 2004. 
Runner up - European Information Management awards 2004:
- The Premier Project Award. 
- B2C Commerce Project Award. 
- CRM Project Award. 

For more information visit us at www.voxgen.com

#
Note:
This message is for the named person's use only.  It may contain confidential, 
proprietary or legally privileged information.  No confidentiality or privilege 
is waived or lost by any mistransmission.  If you receive this message in 
error, please immediately delete it and all copies of it from your system, 
destroy any hard copies of it and notify the sender.  You must not, directly or 
indirectly, use, disclose, distribute, print, or copy any part of this message 
if you are not the intended recipient. Vox Generation Limited and any of its 
subsidiaries each reserve the right to monitor all e-mail communications 
through its networks.

Any views expressed in this message are those of the individual sender, except 
where the message states otherwise and the sender is authorised to state them 
to be the views of any such entity.

Thank You.
#

#
This e-mail message has been scanned for Viruses and Content and cleared by 
NetIQ MailMarshal 
#

-
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]



RE: Can't multipart post large(ish) files via Tomcat 5.0.28

2005-04-19 Thread Pawson, David
http://jakarta.apache.org/commons/fileupload/using.html

says

// Create a new file upload handler
DiskFileUpload upload = new DiskFileUpload();

// Set upload parameters
upload.setSizeThreshold(yourMaxMemorySize);
upload.setSizeMax(yourMaxRequestSize);
upload.setRepositoryPath(yourTempDirectory);


which enables the use of a write to disk when big facility.

HTH DaveP.
 

-Original Message-
From: Derrick Koes [mailto:[EMAIL PROTECTED] 
Sent: 19 April 2005 13:43
To: Tomcat Users List
Subject: RE: Can't multipart post large(ish) files via Tomcat 5.0.28


Are you using struts?

Make sure your controller element tempDir property value 
matches that of the web apps context element's workDir.  
The workDir is where uploaded files over a certain size 
(256KB is the default I think) will be written prior to 
their final destination.  Perhaps Jboss has a working 
directory that needs to match as well.  H.


-Original Message-
From: Gareth Williams [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 19, 2005 7:31 AM
To: Tomcat Users List
Subject: RE: Can't multipart post large(ish) files via Tomcat 5.0.28

Using commons-fileupload results in the same problem.  I 
looked at the source, and the commons class FileUploadBase 
gets its input stream from the HttpServletRequest (as you 
would expect :) and hence I get the same errors/problematic 
behaviour.  Whatever is going wrong would appear to be 
either within Tomcat or within the underlying windows 
socket tcp/ip stuff 

I am surprised nobody else seems to have hit this upload 
problem given the number of people using Tomcat5.0.28 + 
Jboss 3.2.6.  Has anyone got any ideas?

Cheers, Gareth


#
Winner - e-Government excellence 2004. 
Runner up - European Information Management awards 2004:
- The Premier Project Award. 
- B2C Commerce Project Award. 
- CRM Project Award. 

For more information visit us at www.voxgen.com


#
Note:
This message is for the named person's use only.  It may 
contain confidential, proprietary or legally privileged 
information.  No confidentiality or privilege is waived or 
lost by any mistransmission.  If you receive this message 
in error, please immediately delete it and all copies of it 
from your system, destroy any hard copies of it and notify 
the sender.  You must not, directly or indirectly, use, 
disclose, distribute, print, or copy any part of this 
message if you are not the intended recipient. Vox 
Generation Limited and any of its subsidiaries each reserve 
the right to monitor all e-mail communications through its networks.

Any views expressed in this message are those of the 
individual sender, except where the message states 
otherwise and the sender is authorised to state them to be 
the views of any such entity.

Thank You.

#


#
This e-mail message has been scanned for Viruses and 
Content and cleared by NetIQ MailMarshal 

#


-
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]



-- 
DISCLAIMER:

NOTICE: The information contained in this email and any attachments is 
confidential and may be privileged.  If you are not the intended 
recipient you should not use, disclose, distribute or copy any of the 
content of it or of any attachment; you are requested to notify the 
sender immediately of your receipt of the email and then to delete it 
and any attachments from your system.

RNIB endeavours to ensure that emails and any attachments generated by
its staff are free from viruses or other contaminants.  However, it 
cannot accept any responsibility for any  such which are transmitted.
We therefore recommend you scan all attachments.

Please note that the statements and views expressed in this email and 
any attachments are those of the author and do not necessarily represent
those of RNIB.

RNIB Registered Charity Number: 226227

Website: http://www.rnib.org.uk




-
To unsubscribe, e

RE: Can't multipart post large(ish) files via Tomcat 5.0.28

2005-04-15 Thread Derrick Koes
Commons-fileupload.jar 

-Original Message-
From: Gareth Williams [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 15, 2005 8:42 AM
To: tomcat-user@jakarta.apache.org
Subject: Can't multipart post large(ish) files via Tomcat 5.0.28

Hi, I am attempting to add file uploading to an app running under Jboss
3.2.6 + Tomcat 5.0.28.  
Started off using com.oreilly.servlet.MultipartRequest, and found problems 
uploading large 8KB files

Decided to investigate by writing my own class that does nothing except read 
any available bytes from the HttpServletRequest's input stream (i.e. for now, I 
don't actually care about any the content uploaded, just the quantity)... 

public class MyStreamReader {

private static final Logger log =
Logger.getLogger(MyStreamReader.class);

private InputStream inputStream;

private byte[] buf = new byte[1024];

public MyStreamReader(HttpServletRequest request) throws IOException {
log.debug(REQUEST CLASS:  + request.getClass().getName());
this.inputStream = request.getInputStream();
log.debug(INPUT STREAM CLASS:  + inputStream.getClass().getName());
}

public void parse() throws IOException {
int totalBytesRead = 0;

boolean isEndOfStream = false;
while (!isEndOfStream) {

/* Do not use available() as it always returns 0!
 * int available = inputStream.available(); 
 * log.debug(available:  + available);
 */

// Try reading 1 byte at a time (yawn)
int bytesRead = readSingleByte();
// Inconsistent behaviour also results from  int bytesRead = 
readIntoByteArray();

if (bytesRead  0) {
totalBytesRead += bytesRead;
}
else {
isEndOfStream = (bytesRead == -1);
}
}
log.debug(Reached END OF STREAM.);
log.debug(TOTAL BYTES READ:  + totalBytesRead);
}

int readIntoByteArray() throws IOException {
return inputStream.read(buf);
}

int readSingleByte() throws IOException {
int byteValue = inputStream.read();
return (byteValue == -1) ? -1 : 1;
}
}

I then attempted to repeatedly upload a 961KB text file...the log output is as 
follows:

2005-04-15 12:02:36,072 DEBUG
[com.voxgeneration.campaign.gui.VoxServlet]  - processing multi-part request...
2005-04-15 12:02:36,072 DEBUG
[com.voxgeneration.utilities.http.MyStreamReader] REQUEST CLASS:
org.apache.coyote.tomcat5.CoyoteRequestFacade
2005-04-15 12:02:36,072 DEBUG
[com.voxgeneration.utilities.http.MyStreamReader] INPUT STREAM CLASS:
org.apache.coyote.tomcat5.CoyoteInputStream
2005-04-15 12:02:36,072 DEBUG
[com.voxgeneration.utilities.http.MyStreamReader] Reached END OF STREAM.
2005-04-15 12:02:36,072 DEBUG
[com.voxgeneration.utilities.http.MyStreamReader] TOTAL BYTES READ:
36172
2005-04-15 12:02:36,072 ERROR
[com.voxgeneration.campaign.gui.CampaignServlet]  - hmmm...upload failed.

2005-04-15 12:02:42,948 DEBUG
[com.voxgeneration.campaign.gui.VoxServlet]  - processing multi-part request...
2005-04-15 12:02:42,948 DEBUG
[com.voxgeneration.utilities.http.MyStreamReader] REQUEST CLASS:
org.apache.coyote.tomcat5.CoyoteRequestFacade
2005-04-15 12:02:42,948 DEBUG
[com.voxgeneration.utilities.http.MyStreamReader] INPUT STREAM CLASS:
org.apache.coyote.tomcat5.CoyoteInputStream
2005-04-15 12:02:42,963 DEBUG
[com.voxgeneration.utilities.http.MyStreamReader] Reached END OF STREAM.
2005-04-15 12:02:42,963 DEBUG
[com.voxgeneration.utilities.http.MyStreamReader] TOTAL BYTES READ:
37104
2005-04-15 12:02:42,963 ERROR
[com.voxgeneration.campaign.gui.CampaignServlet]  - hmmm...upload failed.

2005-04-15 12:15:31,084 DEBUG
[com.voxgeneration.campaign.gui.VoxServlet]  - processing multi-part request...
2005-04-15 12:15:31,084 DEBUG
[com.voxgeneration.utilities.http.MyStreamReader] REQUEST CLASS:
org.apache.coyote.tomcat5.CoyoteRequestFacade
2005-04-15 12:15:31,084 DEBUG
[com.voxgeneration.utilities.http.MyStreamReader] INPUT STREAM CLASS:
org.apache.coyote.tomcat5.CoyoteInputStream
2005-04-15 12:15:31,084 DEBUG
[com.voxgeneration.utilities.http.MyStreamReader] Reached END OF STREAM.
2005-04-15 12:15:31,084 DEBUG
[com.voxgeneration.utilities.http.MyStreamReader] TOTAL BYTES READ:
37006
2005-04-15 12:15:31,084 ERROR
[com.voxgeneration.campaign.gui.CampaignServlet]  - hmmm...upload failed.

2005-04-15 12:15:36,490 DEBUG
[com.voxgeneration.campaign.gui.VoxServlet]  - processing multi-part request...
2005-04-15 12:15:36,490 DEBUG
[com.voxgeneration.utilities.http.MyStreamReader] REQUEST CLASS:
org.apache.coyote.tomcat5.CoyoteRequestFacade
2005-04-15 12:15:36,490 DEBUG
[com.voxgeneration.utilities.http.MyStreamReader] INPUT STREAM CLASS:
org.apache.coyote.tomcat5.CoyoteInputStream
2005-04-15 12:15:36,506 DEBUG
[com.voxgeneration.utilities.http.MyStreamReader] Reached END OF STREAM.
2005-04-15 12:15:36,506 DEBUG