Last Comment Bug 8209 - ENCTYPE=multipart file upload does not work
: ENCTYPE=multipart file upload does not work
Status: RESOLVED FIXED
[TESTCASE] file upload data not submi...
:
Product: Core
Classification: Components
Component: HTML: Form Submission (show other bugs)
: Trunk
: All All
: P3 major (vote)
: M15
Assigned To: Eric Pollmann
: bsharma
Mentors:
http://cgi-lib.stanford.edu/cgi-lib/e...
Depends on: 13997
Blocks: 7228 7973 16950
  Show dependency treegraph
 
Reported: 1999-06-15 12:17 PDT by Frank Tang
Modified: 2002-12-16 11:48 PST (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
file upload form (540 bytes, text/html)
1999-07-10 05:07 PDT, Christian Wenz
no flags Details
Test upload with M12 (2.25 KB, patch)
1999-12-14 16:28 PST, Eric Pollmann
no flags Details | Diff | Splinter Review
upload test of text doc - win98 (143 bytes, text/plain)
2000-05-03 09:55 PDT, ckritzer (gone)
no flags Details
upload test html doc for MacOS9 (538 bytes, text/html)
2000-05-03 09:59 PDT, ckritzer (gone)
no flags Details
upload test html file for linux6 (534 bytes, text/html)
2000-05-03 10:01 PDT, ckritzer (gone)
no flags Details

Description Frank Tang 1999-06-15 12:17:21 PDT
Somehow the form submission w/ multipart does not work. Which mean we cannot do
file upload. Try the form and cgi script.
Comment 1 Frank Tang 1999-06-15 12:20:59 PDT
also we have the local copy of that in
http://cgi-lib.stanford.edu/cgi-lib/ex/perl5/fup.html (w/ perl script of cgi)
Comment 2 bobj 1999-06-30 13:47:59 PDT
Bug #7973 was "fixed" in M7, but is dependent upon this to work.
Comment 3 apsmith 1999-07-02 20:32:59 PDT
If you don't have another test page, try the one we set up at:

http://publish.aps.org/esub/apstest/test.html

It handles a single file upload test case using Lincoln Stein's
CGI.pm perl module to process the result. Works for us since Netscape 2.x
(but not even now for MSIE 4.5 on the Mac - some MSIE's work).

-- Arthur Smith (apsmith@aps.org)
Comment 4 Christian Wenz 1999-07-10 05:07:59 PDT
Created attachment 780 [details]
file upload form
Comment 5 Christian Wenz 1999-07-10 05:13:59 PDT
Overview Description: form file upload feature does not work
Steps to reproduce: install a cgi-script capable of handling file uploads or use
the page at http://publish.aps.org/esub/apstest/test.html; enter the filename of
a local file in the textbox and click on "submit this file"
Actual Results: nothing happens, to response from the server
Expected Results: the server to print out a new page, showing the contents of
the uploaded file
Build Date & Platform: occurs M7 and current daily build (Win32)
                       does not occur on IE3+ and NN3+ (Win32) [there, the
server does respond]
Additional information: dind't touch the html file from
http://publish.aps.org/esub/apstest/test.html, is it cannot be simplified
further.
The file data does not seem to be submitted correctly (maybe no correct MIME
encoding / MIME separators?), making the script go nuts. There is no entry in
the server logs when calling the script from M7.
Comment 6 connolly 1999-07-22 17:51:59 PDT
It appears in pages that has multiple form tags on it - see www.myevents.com -
try uploading a file.
Comment 7 bobj 1999-08-18 04:10:59 PDT
Isn't this dogfood because we cannot create bugzilla attachments without this?
Comment 8 Eric Pollmann 1999-09-21 08:45:59 PDT
Bumping up priority.
Comment 9 Eric Pollmann 1999-09-21 08:51:59 PDT
Need to fix the crash first, of course :)
Comment 10 Eric Pollmann 1999-09-30 19:55:59 PDT
Just checked in a fix.
To verify, try to attach a file to this bug using apprunner.  If it works, the
bug is fixed.  Note that, at least on Linux, you must select a file from the
current directory.  This is being worked on - see bug 15317
Comment 11 Eric Pollmann 1999-09-30 19:56:59 PDT
Just checked in a fix.
To verify, try to attach a file to this bug using apprunner.  If it works, the
bug is fixed.  Note that, at least on Linux, you must select a file from the
current directory.  This is being worked on - see bug 15317
Comment 12 cpratt 1999-10-18 11:40:59 PDT
I'm currently trying to upload a file using the 1999101808 build under NT...
it's been 'Transferring data' for about ten minutes so far (and that file ain't
that huge). I'll update if/when the upload finishes...
Comment 13 cpratt 1999-10-18 13:50:59 PDT
OK, I've been trying all morning to upload a file to bugzilla using the
1999101808 build on NT. Is something else broken, is this bug not fixed...
anyone have an idea? Thanks!
Comment 14 Eric Pollmann 1999-10-18 15:19:59 PDT
Checking this out...
Comment 15 Eric Pollmann 1999-10-26 15:17:59 PDT
This looks like it was caused by some changes recently made to Necko's http
library.  The form upload data is no longer getting written at all.

Rick, is this something you are aware of?  There is a test case in this bug.
Another is at http://blueviper/forms/multipart2.html.  Using this testcase, and
a simple server, I observed this data being posted:

pollmann blueviper(43):~> echoserver.prompt
Listening for clients on port 8000.
--------Got a new client.
POST /echo.cgi HTTP/1.0
host: blueviper:8000
accept: */*
user-agent: Mozilla/5.0 [en-US] (Linux; I)
referer: http://blueviper/forms/multipart2.html
--------Client hung up, responding.
--------Done.

But at the same time, the form post data file is correct and exists in /tmp.
This seems to be related to some recent changes you've made breaking apart and
improving nsHTTPRequest::Build, and the error seems centered around
nsHTTPRequest::OnStopRequest where the post data stream is asynchronously
written to the server.  Any ideas?  Do you want this bug?
Comment 16 Eric Pollmann 1999-11-01 12:37:59 PST
Changes to fix this problem have been checked in, still working on getting this.
Comment 17 Eric Pollmann 1999-12-01 14:41:59 PST
After careful consideration, I've decided that I probably won't get this bug in
for M12.  Currently I have nearly 50 bugs scheduled for M13, so there is a
possibility that this bug may need to be moved out farther still.
Comment 18 gerardok 1999-12-02 16:44:59 PST
QA Contact update.
Comment 19 Eric Pollmann 1999-12-14 16:28:59 PST
Created attachment 3495 [details] [diff] [review]
Test upload with M12
Comment 20 Eric Pollmann 1999-12-14 16:29:59 PST
Whatever changes had happened to break my fix seem to have reversed.  It works
for me now, so I'm marking it fixed.  Cool.  :)
Comment 21 ckritzer (gone) 2000-02-01 17:04:19 PST
Doesn't work on:
- MacOS86 2000-02-01-09 Commercial build
Can't upload file...
Comment 22 ckritzer (gone) 2000-02-09 07:10:21 PST
Still broken for MacOS86 2000-02-08-17 mozilla build.  Tested against Win32 and
Linux builds of same date and they work fine.  

Used the http://publish.aps.org/esub/apstest/test.html link.
Comment 23 chrisn 2000-02-17 05:53:49 PST
Does not work on Win32 2000021608 build on Windows 98.

Used this testcase:

http://publish.aps.org/esub/apstest/test.html

I also tried it with a file-submission form on a private site of mine, and it
didn't work, either. The application churns but nothing else happens (the form
never seems to be submitted)
Comment 24 Eric Pollmann 2000-03-27 18:56:34 PST
I just tested at:

http://publish.aps.org/esub/apstest/test.html

And posting worked fine for me.  Re-closing.  If you are still having problems,
please Reopen and give details such as platform, size of file, file nemae, ...

Note also that it may take a long time for larger files to upload to the
server.  Thanks!
Comment 25 ckritzer (gone) 2000-05-03 09:55:36 PDT
Created attachment 8251 [details]
upload test of text doc - win98
Comment 26 ckritzer (gone) 2000-05-03 09:59:45 PDT
Created attachment 8253 [details]
upload test html doc for MacOS9
Comment 27 ckritzer (gone) 2000-05-03 10:01:28 PDT
Created attachment 8257 [details]
upload test html file for linux6
Comment 28 ckritzer (gone) 2000-05-03 10:02:49 PDT
Marking VERIFIED FIXED on:
- MacOS9 2000-05-02-08-M15 Commercial
- Linux6 2000-05-02-08-M15 Commercial
- Win98  2000-05-02-08-M15 Commercial
Comment 29 Dima Tkach 2002-01-23 13:32:13 PST
It still doesn't work, if the file doesn't exits (or if the empty filename is
specified).
Here is a cgi-script to reproduce it: put it into a cgi-bin directory, then go
to cgi-bin/env?form 
This will show a form with a "file" input and a "submit" button. 
If you just push "submit" - it will never never return...
If you enter a valid (existing) path into the input field and submit again, 
you'll see a print out of the environment and the content of the file...
This is especially bad because there is no way to check whether the file exists
on the client side :-(

#!/bin/csh -f

if ($?QUERY_STRING) then
   if ("$QUERY_STRING" == "form")  then
      cat <<EOF
Content-type: text/html;"


<html>
<body>
<form action=env method=post enctype="multipart/form-data">
<input type=file name=file><br>
<input type=submit name=sub value="Submit">
</form>
</html>
EOF   
      exit
   endif
endif


echo "Content-type: text/plain"
echo ""
echo ""
echo "**** COMMAND: $0 ****"
env

if ("$REQUEST_METHOD" == "POST") then
   echo $CONTENT_LENGTH
   head -c $CONTENT_LENGTH
endif


Comment 30 Olav Vitters 2002-01-23 14:07:32 PST
Works fine. Please use a recent nightly build and test it again. If you are
using 0.9.7, see bug 116210.

Note You need to log in before you can comment on or make changes to this bug.