Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3229272
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:47:30+00:00 2026-05-17T16:47:30+00:00

When uploading one file using <input type=file /> in Opera, it works as expected.

  • 0

When uploading one file using <input type="file" /> in Opera, it works as expected. That is, you find the expected file data in $_FILES in PHP server side.

However, when I try to upload several files at once using Opera, by setting <input type="file" min="1" max="999" /> then all the files’ contents are glued together in one long string and sent as POST data. All the files in this string are separated by headers such as this:

------------94QV8HRqBwta8NY4L2WH0r
Content-Disposition: form-data; name="file[]"; filename="xxx1069225496.xml"
Content-Type: text/xml

<?xml>
...

Opera follows the Webforms 2.0 standard, I know. But is there a simple way to make Opera send multiple files in the same fashion other browsers do, or will I have to write an interpreter to get files just from Opera?

Thanks for any help. Below is the HTML I’m currently using.


<div id="filearea">
    <input type="file" min="1" max="6000" accept="text/xml" name="file[]" style="padding: 1px; margin: 2px 0px;" />
</div>

This is how the var_dump of $_POST looks (I’ve erased any actual XML data, taking up space)

array(1) {
  ["file"]=>
  array(1) {
    [0]=>
    string(4209) "------------94QV8HRqBwta8NY4L2WH0r
Content-Disposition: form-data; name="file[]"; filename="1219854274.xml"
Content-Type: text/xml

<?xml version="1.0"?>
...

------------94QV8HRqBwta8NY4L2WH0r
Content-Disposition: form-data; name="file[]"; filename="xxx1069225496.xml"
Content-Type: text/xml

<?xml version="1.0"?>
...

------------94QV8HRqBwta8NY4L2WH0r
Content-Disposition: form-data; name="file[]"; filename="xxx1111008062.xml"
Content-Type: text/xml

<?xml version="1.0"?>
...

------------94QV8HRqBwta8NY4L2WH0r
Content-Disposition: form-data; name="file[]"; filename="1219854274.xml"
Content-Type: text/xml

<?xml version="1.0"?>
...
    "
  }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T16:47:30+00:00Added an answer on May 17, 2026 at 4:47 pm

    I just checked a PHP bug report, and it claimed that this works in Opera:

    <input type="file" name="file" min="1" max="999" />
    

    But that this does not:

    <input type="file" name="file[]" min="1" max="999" />
    

    Edit: After testing this, I believe the PHP person who marked the bug as bogus didn’t know what he was talking about… I cannot get either way to work natively with PHP.

    As far as I can tell, PHP does not support Opera’s ‘mixed’ file uploads. This is not a bug on Opera’s part, as they are implementing it per the RFC’s specification. I believe the other browsers simply upload the files as if there were multiple input elements. You could easily add support for this by checking the _POST array:

       $file = $_POST['file'][0];
    
       while (preg_match('/^(-+[A-Za-z0-9]+)\s+/', $file, $matches))
       {
          $id = $matches[1];
    
          $i = strlen($matches[0]);
          $body = false;
          $headers = array();
          while (($j = strpos($file, "\n", $i)) !== false)
          {
             $line = substr($file, $i, $j - $i);
             $i = $j + 1;
             if (trim($line) == '')
             {
                $body = true;
                break;
             }
    
             list($key, $val) = explode(':', trim($line), 2);
             $headers[$key] = trim($val);
          }
          if (!$body) break;
    
          $j = strpos($file, $id, $i);
    
          $data = substr($file, $i, $j-$i);
          echo $data."<HR>"; // also check $headers
    
          $file = substr($file, $j);
       }
    

    There may be some off-by one errors in the above code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm uploading one file from one server to other using ssh2_scp_send(). Everything works fine,
Imagine this simple form for uploading a file: <form action=upload enctype=multipart/form-data> <input type=text name=name/>
I am uploading large files to an ASP.NET server using a standard HTML <input>
I'm implementing file uploading using Richfaces version 4.0. I've noticed, that there is quite
Uploading a file in PHP results in a map. One of the keys, tmp_name,
I was uploading my file using below code,it works fine but some time it
I am uploading multiple images (4 file fields) using paperclip, which is working fine
I'm building an application that needs to use a web server like a file
I'm uploading image file to storage server. Before uploading I should compose filename, which
I am uploading file using jQuery uploadify plugin. Each time I upload a file,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.