|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47789 Opera file upload - multiple files from one input cannot be handled
Submitted: 2009-03-26 14:33 UTC Modified: 2010-12-01 04:45 UTC
From: michal dot aichinger at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.9 OS: Windows / Linux
Private report: No CVE-ID: None
 [2009-03-26 14:33 UTC] michal dot aichinger at gmail dot com
Code below makes form with one file input. In Opera and Safari 4 it is possible select more than one file in this input. If you send this form in Safari it is in PHP normaly handled like multi file upload (multiple inputs). Upload from Opera caused empty $_FILES array. 

The diference between this browsers is that Opera use multipart/mixed for packing files from this input when posting data.

Reproduce code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="" xml:lang="cs" lang="cs">
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
	<form action="test.php" method="post" enctype="multipart/form-data">
		<input type="file" name="files[]" multiple="multiple" min="0" max="5" />
		<input type="submit" />

Expected result:
full $_FILES array after sending more files selected in files[] input  from Opera

Actual result:
array is empty


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-31 07:20 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

 [2009-03-31 07:32 UTC] michal dot aichinger at gmail dot com
I am pretty shure that this is bug. PHP does not respect multipart/mixed  part in POST request and it is clearly a bug. This part is valid and is made only by Opera in this example.
 [2010-06-19 18:28 UTC] spamdeja at mail dot ru
It's true bug of php
 [2010-06-19 18:34 UTC] sowingsadness at gmail dot com

>3.3 use of multipart/form-data
>   The definition of multipart/form-data is included in section 7.  A
>   boundary is selected that does not occur in any of the data. (This
>   selection is sometimes done probabilisticly.) Each field of the form
>   is sent, in the order in which it occurs in the form, as a part of
>   the multipart stream.  Each part identifies the INPUT name within the
>   original HTML form. Each part should be labelled with an appropriate
>   content-type if the media type is known (e.g., inferred from the file
>   extension or operating system typing information) or as
>   application/octet-stream.
>   If multiple files are selected, they should be transferred together
>   using the multipart/mixed format.
 [2010-06-21 17:59 UTC] imbolk at gmail dot com

What about this bug?

It's not bogus!

Returning Values from Forms: multipart/form-data, L. Masinter. IETF, August 1998.

4.2 Sets of files

If the value of a form field is a set of files rather than a single
file, that value can be transferred together using the
«multipart/mixed» format.
 [2010-11-30 21:10 UTC] imbolk at gmail dot com
Hello! It is not bogus! Look at RFC2388!
 [2010-12-01 04:45 UTC]
This is also covered by request #50338 -- which is still open. I'll add
a note to it that this affects more than just Web Forms 2.0.
 [2011-04-03 21:30 UTC] sergei dot fukurokudzu at gmail dot com
Hi there. It's realy php bug. can you solve it finaly please?!
 [2012-08-09 11:45 UTC] carlosbacco at gmail dot com
Why devs seem to be ignoring this ugly and olg bug? Do PHP devs have something against Opera?
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 02:01:29 2024 UTC