Re: Apache2::Upload ->upload method dies silently if any file field is empty

"Randolf Richardson via modperl" <[email protected]> Thu, 17 Jul 2025 12:09:43 -0700
Newsgroups gmane.comp.apache.mod-perl
Organization Inter-Corporate Computer & Network Services
Message-ID <[email protected]>
	I've been down this road.  If wrapping $r->upload() in an eval block 
doesn't solve the problem, it's likely that you need to upgrade 
libapreq2 to v2.18 (or newer):

		https://www.inter-corporate.com/kb/internal-apreq-error.pl

	If your Linux distribution doesn't include libapreq2 v2.18 (or 
newer), the instructions at the above link provides the steps for 
compiling from offical source and upgrading to it.

> I am seeing some very suprising behavior with calling ->upload on a 
> Apache2::Request object (with use Apache2::Upload). It appears that if 
> the user did not click and select a file to upload, that is to say left 
> the <input type=3D"file" ...> field empty, the server stops processing t=
he 
> perl code and immediately sends a response to the browser with whatever 
> it has so far. No error message appears in the error log.
> 
> It appears that this happens if *any* file field is left un-filled, that=
 
> is to say, ->upload("file1") will silently die even if file1 was 
> specified, if file2 was left un-filled.
> 
> I have written up a description and replication code here:
> 
> http://back.nber.org/sys-admin/apache2_upload_bug.html
> 
> Is this something anyone else has seen?
> 
> Thanks,
> 
>  =A0- Alex Aminoff
> 
>  =A0=A0 NBER
> 
> 


Randolf Richardson, CNA - [email protected]
Inter-Corporate Computer & Network Services, Inc.
Beautiful British Columbia, Canada
https://www.inter-corporate.com/