|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: gsohl at freedomgroup dot com
New email:
PHP Version: OS:


 [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:

Content-Disposition: attachment; name="userfile"; filename="boot.ini"
Content-Type: application/octet-stream;

file data.....

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 ( 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.


Add a Patch

Pull Requests

Add a Pull Request


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


PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 20:01:29 2024 UTC