php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7685 File Upload Fails with Headers in Unexpected Order
Submitted: 2000-11-07 22:36 UTC Modified: 2001-05-27 21:06 UTC
From: gsohl at freedomgroup dot com Assigned:
Status: Closed Package: HTTP related
PHP Version: 4.0.3pl1 OS: Windows NT 4.0 Workstation
Private report: No CVE-ID: None
 [2000-11-07 22:36 UTC] gsohl at freedomgroup dot com
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-27 21:06 UTC] sniper@php.net
This should be fixed. If this happens with PHP 4.0.5, reopen
this bug report.

--Jani

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Aug 18 02:01:26 2019 UTC