>Number: 2456
>Category: general
>Synopsis: Cannot upload binary file with HTML tag <INPUT TYPE=file>
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: apache
>State: open
>Class: sw-bug
>Submitter-Id: apache
>Arrival-Date: Wed Jun 17 00:50:00 PDT 1998
>Last-Modified:
>Originator: [EMAIL PROTECTED]
>Organization:
apache
>Release: 1.3b5, 1.3b6, 1.3 (WIN32)
>Environment:
Windows NT workstation 4.0 Service Pack 3
Visual C++ 5.0
>Description:
When I use the HTML tag <INPUT TYPE=file> to upload an ASCII file,
the apache web server handles it correctly and I retrieve it with CGI_Lite.
But when I try to upload a binary file, it either retrieve only 600-800 bytes
if the file is not too big. Otherwise, it hangs.
I do not think it is a problem with CGI_Lite because if I do not use this
module,
the web server still hangs when the file is too big. It is not clear what too
big
is but it seems to be over 20K.
>How-To-Repeat:
Here is the HTML file
<HTML>
<BODY>
<FORM ACTION="/cgi-bin/test_file_upload" ENCTYPE="multipart/form-data"
METHOD=POST>
Select a file to send: <INPUT TYPE=file NAME=input_file>
<INPUT TYPE=submit VALUE="Send file">
</FORM>
</BODY>
</HTML>
Here is the perl script to handle the form data
#!c:/perl/bin/perl.exe
use CGI_Lite;
$cgi=new CGI_Lite();
$cgi->set_directory("c:/temp");
$cgi->set_file_type("name");
%Data=$cgi->parse_form_data();
print "Content-type: text/plain\n\n";
print "<HTML><BODY>$Data{'input_file'}\n<BR>";
>Fix:
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <[EMAIL PROTECTED]> in the Cc line ]
[and leave the subject line UNCHANGED. This is not done]
[automatically because of the potential for mail loops. ]