Issue Details (XML | Word | Printable)

Key: FILEUPLOAD-104
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Ralf Hauser
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons FileUpload

[fileupload] process lynx linemode browser's multipart form post too!

Created: 15/Dec/03 05:27 PM   Updated: 09/Mar/07 08:32 PM
Return to search
Component/s: None
Affects Version/s: 1.1 Final
Fix Version/s: 1.2

Time Tracking:
Not Specified

File Attachments:
  Size
Text File patch.txt 2004-06-14 10:23 PM Ralf Hauser 0.6 kB
Environment:
Operating System: Linux
Platform: PC

Bugzilla Id: 25527
Resolution Date: 06/Aug/06 04:07 AM


 Description  « Hide
Regular form posts with Lynx Version 2.8.5dev.7 (06 Jan 2002) work fine (both
from Redhat 9 as well as win2k cygwin).

However, when doing an <<enctype="multipart/form-data">>, all form fields are
reported to be empty in struts.
From a quick tcpflow sniffing comparison of the same form post by Mozilla and
lynx, it appears that one main difference is that the lynx doesn't quote the
field names?

Next excerpts from the sniffing session.
Mozilla:
<<POST /smtpsExim/smtpsProcess.do HTTP/1.1
Host: localhost:2712
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031
129
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plai
n;q=0.8,image/png,image/jpeg,image/gif;q=0.2,/;q=0.1
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Content-Type: multipart/form-data; boundary=---------------------------276443266
232757
Content-Length: 1505

-----------------------------276443266232757
Content-Disposition: form-data; name="login"

hauser@acm.org
-----------------------------276443266232757
Content-Disposition: form-data; name="to"

abc@uvw.ch
-----------------------------276443266232757
Content-Disposition: form-data; name="subject"

testsubjMozilla
-----------------------------276443266232757
Content-Disposition: form-data; name="body"

bodyMozilla
-----------------------------276443266232757
Content-Disposition: form-data; name="file"; filename="killTomcat.sh"
Content-Type: application/x-sh

#!/bin/sh
list=`ps -ef | grep tomcat | grep catalina | grep -v grep | awk '{ print $2}'`
echo killing $list
for i in $list
do
...>>

and lynx:
<<POST /smtpsExim/smtpsProcess.do HTTP/1.0
Host: localhost:2712
Accept: text/html, text/plain, audio/mod, image/*, application/msword, applicati
on/pdf, application/postscript, application/x-java-jnlp-file, text/sgml, video/m
peg, /;q=0.01
Accept-Encoding: gzip, compress
Accept-Language: en
Pragma: no-cache
Cache-Control: no-cache
User-Agent: Lynx/2.8.5dev.7 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7
Content-type: multipart/form-data; boundary=xnyLAaB03X
Content-length: 1347

--xnyLAaB03X
Content-Disposition: form-data; name=login
Content-Type: text/plain

hauser@acm.org
--xnyLAaB03X
Content-Disposition: form-data; name=to
Content-Type: text/plain

abc@uvw.ch
--xnyLAaB03X
Content-Disposition: form-data; name=subject
Content-Type: text/plain

testSubjLynx
--xnyLAaB03X
Content-Disposition: form-data; name=body
Content-Type: text/plain

lynxBody
--xnyLAaB03X
Content-Disposition: form-data; name=file; filename="killTomcat.sh"
Content-Type: text/plain
...>>

once that's solved, it will be interesting whether Regular form posts with Lynx Version 2.8.5dev.7 (06 Jan 2002) work fine (both
from Redhat 9 as well as win2k cygwin).

However, when doing an <<enctype="multipart/form-data">>, all form fields are
reported to be empty in struts.
From a quick tcpflow sniffing comparison of the same form post by Mozilla and
lynx, it appears that one main difference is that the lynx doesn't quote the
field names?

Next excerpts from the sniffing session.
Mozilla:
<<POST /smtpsExim/smtpsProcess.do HTTP/1.1
Host: localhost:2712
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031
129
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plai
n;q=0.8,image/png,image/jpeg,image/gif;q=0.2,/;q=0.1
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Content-Type: multipart/form-data; boundary=---------------------------276443266
232757
Content-Length: 1505

-----------------------------276443266232757
Content-Disposition: form-data; name="login"

hauser@acm.org
-----------------------------276443266232757
Content-Disposition: form-data; name="to"

abc@uvw.ch
-----------------------------276443266232757
Content-Disposition: form-data; name="subject"

testsubjMozilla
-----------------------------276443266232757
Content-Disposition: form-data; name="body"

bodyMozilla
-----------------------------276443266232757
Content-Disposition: form-data; name="file"; filename="killTomcat.sh"
Content-Type: application/x-sh

#!/bin/sh
list=`ps -ef | grep tomcat | grep catalina | grep -v grep | awk '{ print $2}'`
echo killing $list
for i in $list
do
...>>

and lynx:
<<POST /smtpsExim/smtpsProcess.do HTTP/1.0
Host: localhost:2712
Accept: text/html, text/plain, audio/mod, image/*, application/msword, applicati
on/pdf, application/postscript, application/x-java-jnlp-file, text/sgml, video/m
peg, /;q=0.01
Accept-Encoding: gzip, compress
Accept-Language: en
Pragma: no-cache
Cache-Control: no-cache
User-Agent: Lynx/2.8.5dev.7 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7
Content-type: multipart/form-data; boundary=xnyLAaB03X
Content-length: 1347

--xnyLAaB03X
Content-Disposition: form-data; name=login
Content-Type: text/plain

hauser@acm.org
--xnyLAaB03X
Content-Disposition: form-data; name=to
Content-Type: text/plain

abc@uvw.ch
--xnyLAaB03X
Content-Disposition: form-data; name=subject
Content-Type: text/plain

testSubjLynx
--xnyLAaB03X
Content-Disposition: form-data; name=body
Content-Type: text/plain

lynxBody
--xnyLAaB03X
Content-Disposition: form-data; name=file; filename="killTomcat.sh"
Content-Type: text/plain
...>>

once that's solved, it will be interesting whether Bug 21954 is already gone
with the commons-fileupload or whether I really have to wait until struts1.2 is already gone
with the commons-fileupload or whether I really have to wait until struts1.2



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Ralf Hauser added a comment - 15/Feb/04 03:32 PM
there seems to be the same problem with MSIE5.1 on Mac G3

Ralf Hauser added a comment - 12/May/04 12:36 AM
the same problem also with the browser on the Sony Ericsson P900 phone
(aparently, a symbian port of opera)

Ralf Hauser added a comment - 14/Jun/04 10:22 PM
good news - linemode browser Links 0.96 doesn't have the problem!

Ralf Hauser added a comment - 14/Jun/04 10:23 PM
Created an attachment (id=11844)
legacy patch to FileUploadBase.java

Ralf Hauser added a comment - 14/Jun/04 10:26 PM
it would be great if the backWardCompat variable wouldn't have to be set in the
.java source, but could be set as a controller property in struts-config.xml

Ralf Hauser added a comment - 01/Jul/04 11:04 AM
a little bit more of history that is more present than we would like: same
problem on Mac OS 9.1 with Netscape 4.7 and MSIE 5.0

Ralf Hauser added a comment - 21/Aug/04 01:39 PM
just for the reference http://www.ietf.org/rfc/rfc2388.txt

Ralf Hauser added a comment - 22/Sep/04 11:48 PM
see also see also Bug 31369 for Pocket Explorer for Windows CE on a Pocket Loox 600 from
Siemens for Pocket Explorer for Windows CE on a Pocket Loox 600 from
Siemens

Martin Cooper added a comment - 17/Oct/04 01:20 AM
Fixed in the 20041017 nightly build.

Ralf Hauser added a comment - 02/Dec/05 12:26 AM
again having some problems with the latest lynx --version
Lynx Version 2.8.5rel.1 (04 Feb 2004)
libwww-FM 2.14, SSL-MM 1.4.1, GNUTLS 1.0.16
Built on linux-gnu Sep 26 2004 12:53:36

as per "apt-get" on debian sarge:

Dec 1, 2005 4:18:38 PM org.apache.struts.upload.CommonsMultipartRequestHandler
handleRequest
SEVERE: Failed to parse multipart request
org.apache.commons.fileupload.FileUploadException: Processing of
multipart/form-data request failed. Read timed out
at
org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:376)
at
org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:266)
at
org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest(CommonsMultipartRequestHandler.java:193)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:443)
at
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:804)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:827)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:731)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Dec 1, 2005 4:18:38 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet action threw exception
org.apache.commons.fileupload.FileUploadException: Processing of
multipart/form-data request failed. Read timed out
at
org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:376)
at
org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:266)
at
org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest(CommonsMultipartRequestHandler.java:193)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:443)
at
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:804)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:827)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:731)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)


Ralf Hauser added a comment - 02/Dec/05 12:33 AM
admitted, the attachment had 20 MB, but I allow 70 MB

Martin Cooper added a comment - 02/Dec/05 04:40 AM
Do you have any evidence to support this being a bug in Struts / FileUpload,
rather than a bug in the latest version of Lynx?

Ralf Hauser added a comment - 02/Dec/05 05:53 AM
Martin, you may be right, I guess the next diagnostic steps would be to post to
http instead of https and then do an ethereal or tcpflow dump. I'll post the
results once I get to them (apologies, may take some time...)

Jochen Wiedmann added a comment - 06/Aug/06 04:07 AM
The user hasn't returned in more than one year, so I assume the problem's fixed indeed, as written by Martin.