Apache w/multi-part/form-data file uploads.

Apache w/multi-part/form-data file uploads.

Post by Master SinSorcere » Wed, 12 Apr 2000 04:00:00


Does anyone know what apache presents to a cgi script when a field in a
posted form is of type="file" and the enctype for the form is
multi-part/form-data?

I know Lincoln Stein's CGI.pm can handle this an passes a temp file handle,
but for various reasons I can't use CGI.pm for this script.

Appreciate any help...

/s/ Harley

 
 
 

Apache w/multi-part/form-data file uploads.

Post by Alan J. Flavel » Wed, 12 Apr 2000 04:00:00


On Tue, 11 Apr 2000, Master SinSorcerer wibbled:

Quote:> Does anyone know what apache presents to a cgi script when a field in a
> posted form is of type="file" and the enctype for the form is
> multi-part/form-data?

It presents the MIME-encoded content via the CGI interface, as
documented in the specs.

Quote:> I know Lincoln Stein's CGI.pm can handle this an passes a temp file handle,
> but for various reasons I can't use CGI.pm for this script.

Perhaps correcting whatever "reasons" are hindering you from making
use of this standard part of any current Perl installation would be
the most effective way of addressing your problem.

Otherwise I'd say it's up to you to study the specs and reinvent thw
wheel, or take your cue from the existing CGI.pm source and base
yours on that.   I'm sorry if that sounds unsympathethic, but what do
you expect when you come here saying "I know what the solution is but
I won't use it and I'm not telling you why, so please help me"?

 
 
 

Apache w/multi-part/form-data file uploads.

Post by Ole Tang » Thu, 13 Apr 2000 04:00:00



> Does anyone know what apache presents to a cgi script when a field in a
> posted form is of type="file" and the enctype for the form is
> multi-part/form-data?

> I know Lincoln Stein's CGI.pm can handle this an passes a temp file handle,
> but for various reasons I can't use CGI.pm for this script.

Is there any reason why you cannot just read CGI.pm and see how it is
implemented and do the same?

/Ole

 
 
 

1. Apache2.0 uploading large multipart/form-data truncated

I'm having problems uploading large binary files from a web browser
using Apache (2.0.45) on HP-UX 11.  It seems that small binary files
(around 15k) upload OK, but larger files (>15k?) are getting
truncated.

When using CGI.pm (2.93), this will result in the infamous error
message:
CGI.pm: Server closed socket during multipart read (client aborted?)

However, writing my own CGI client without the CGI Perl module, it
seems that Apache just stops sending the form data part way through,
i.e. data is truncated.  This seems to be an Apache problem and the
client browser used makes no difference (tested with IE5.0 on NT and
Netscape 4.8 on HP-UX).

I've not changed any of the tunable Apache directives from defaults,
hence there should be no throttling based on file size, etc.

Running the same version of Apache on Linux (x86) doesn't seem to
exhibit this problem.  I'm wondering if this is something funny with
HP-UX?   I've spent a couple of days searching Google and it seems a
few people have hit the above CGI error with Apache2 on HP-UX,
although there is never a solution.  For what its worth, the files I'm
trying to upload are binary Microsoft Excel about 17k in size.

I've had this problem for a while across the last 3 or 4 Apache 2
builds, but I'm getting pushed by my users to get the problem sorted.
Before I go digging into the Apache source, has anyone got any ideas?

Mark.

2. Samba problems

3. Apache/Solaris slow POSTing large file using enctype="multipart/form-data"

4. SonyPI driver updates.

5. PS Command

6. optimizing multipart/form-data uploads

7. /bin/last incorrect?

8. where do multipart/form-data files go in Apache?

9. Multi-part document uploading.

10. Info about a file during upload (upload with post through a form)

11. How to handle file uploads in forms with apache 1.2?

12. Multipart/form-data decoding in Apache C modules~~~