PHP 4.0 Bug #7685: File Upload Fails with Headers in Unexpected Order

From: Date: Tue, 07 Nov 2000 21:36:00 +0000
Subject: PHP 4.0 Bug #7685: File Upload Fails with Headers in Unexpected Order
Groups: php.dev 
Request: Send a blank email to php-dev+get-37385@lists.php.net to get a copy of this message
From: gsohl@freedomgroup.com Operating system: Windows NT 4.0 Workstation PHP version: 4.0.3pl1 PHP Bug Type: *General Issues Bug description: File Upload Fails with Headers in Unexpected Order The code for implementing RFC1867 with a file upload (in rfc1867.c) expects headers to be in the order: --Boundary........... Content-Disposition: attachment; name="userfile"; filename="boot.ini" Content-Type: application/octet-stream; file data..... --Boundary........... However, RFC1867 does not enforce this ordering. Some clients generate the Content-Type header prior to the Content-Disposition header which causes the file upload to fail, without any error message being generated. I discovered this using a set up components from Dev-Soft (www.dev-soft.com) in Borland's Delphi. Their MIME component generates the multi-part form data for a file with Content-Type before the Content-Disposition. After beating my head against the wall for a few hours I finally figured out where the problem was. Fortunatly I was able to circumvent their ordering, although it made my code pretty kludgy. -- Edit Bug report at: http://bugs.php.net/?id=7685&edit=1

« previous php.dev (#37385) next »