Uploads to mod_perl 1.3 truncated




12 years ago
12 years ago


(Reporter: mcrawfor, Unassigned)


Firefox Tracking Flags

(Not tracked)





12 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20060601 Firefox/ (Ubuntu-edgy)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20061204 Firefox/

Perl version v5.8.5 for Apache/1.3.33 (Unix) mod_ssl/2.8.23 OpenSSL/0.9.8 mod_perl/1.29

When posting a file to the following CGI, as demonstrated at the provided URL, larger files get truncated.  An example file that truncates is located at:

Notice that this file is about 4mb, but when uploaded through the following CGI using Firefox 2 on Windows, it is truncated to roughly 2.5mb.

If you look at the truncated files in a hex editor, there is a strange similarity in the point the file is truncated:

truncated point:
00274fe0:  d6 4c 64 b7 c9 f5 c1 3f  e3 4f a2 8a 28 a2 8a 28  .Ld....?.O..(..(
00274ff0:  a2 8a 28 a2 8a 2b cd 3f  68 9f 0f f8 c3 c6 1f --  ..(..+.?h......-
valid file:
00274fe0:  d6 4c 64 b7 c9 f5 c1 3f  e3 4f a2 8a 28 a2 8a 28  .Ld....?.O..(..(
00274ff0:  a2 8a 28 a2 8a 2b cd 3f  68 9f 0f f8 c3 c6 1f 0a  ..(..+.?h.......
00275000:  75 cf 04 f8 2f 41 4d 46  f7 c4 16 af 66 cc f7 89  u.../AMF....f...

All the files I checked are cut off right before that 0a byte that rolls over to the next round filesize.

I have checked this with Firefox 1.5 and 2.0 on a variety of platforms, and have only seen it using Firefox 2.0 on Windows.


my $r = shift;

use Apache::Request;

my $apr = Apache::Request->new($r);
my $handle = $apr->upload('upload')->fh();

open STORE, ">stored";
while( my $line  = <$handle>){
    print STORE $line;
close STORE;

print "Content-type: text/plain\n\n". `du 'stored'`;

Reproducible: Always

Steps to Reproduce:
1. Upload the sample file to the provided URL or CGI script using Firefox 2.0 on Windows
2.Check the Uploaded filesize.
Actual Results:  
Only part of the file is uploaded.

Expected Results:  
The whole file should be uploaded ;)

I'm setting the severity to major considering the large number of mod_perl 1.3 applications in production use - Here at the University of Washington we are getting more and more complaints about this as people upgrade to FF 2.0

Comment 1

12 years ago
I'm experiencing the same misbehavior reported here.

It seems there is definitely something different in the way large uploads are handled, between Firefox 1.5 and 2.0 for Windows.  In my testing, Linux builds (of any version) do not experience this problem, nor does Internet Explorer, nor does Firefox 1.5.  Only Firefox 2.0 for Windows.

This is uploading to a serving running Apache/1.3.34 (Unix); Perl 5.8.8; mod_perl 1.27.

The bug might lie in libapreq1 (and has been reported on that mailing list), but since only Firefox2/Win triggers the behavior, any information that we can report to that team would be wonderful.

Comment 2

12 years ago
The apreq developers are planning a maintenance release of
libapreq1.  This version primarily addresses an issue noted
with FireFox 2.0 truncating file uploads in SSL mode.

Please give the tarball at


a try and report comments/problems/etc. to the apreq-dev list
at apreq-dev@httpd.apache.org. 
Last Resolved: 12 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 356470
You need to log in before you can comment on or make changes to this bug.