php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57355 cancel_upload parameter get wrong value when using multi field upload form
Submitted: 2006-11-08 04:11 UTC Modified: 2007-02-25 07:11 UTC
From: krudtaa at yahoo dot com Assigned:
Status: Not a bug Package: APC (PECL)
PHP Version: 5.2.0 RC4 OS: Windows XP Pro
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
13 + 26 = ?
Subscribe to this entry?

 
 [2006-11-08 04:11 UTC] krudtaa at yahoo dot com
Description:
------------
PHP version 5.2

When using the new APC_UPLOAD_PROGRESS feature and
if you make a multi file upload_form and do not fill out all of the file fields then the
cancel_upload parameter get a value of 4 and the the whole upload is reported as:

Cancelled after 109300234 bytes

even if the upload actually was a success.

Reproduce code:
---------------
Download this source:
http://progphp.com/progress.phps

which I found at:
http://talks.php.net/show/torkey06/24

then change the upload_form so it have more than one upload
field.

I entered three fields like this:

<input type="file" name="test_file[]"/><br/>
<input type="file" name="test_file[]"/><br/>
<input type="file" name="test_file[]"/><br/>

Expected result:
----------------
I would like to see PHP, or the APC extension (do not know which one
causes the error) not raise any errors when some of the file fields are
not filled out.


Actual result:
--------------
cancel_upload parameter should get value of 0 and not 4.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-25 07:11 UTC] rasmus@php.net
As far as I can tell this is working as designed.  When you have 3 upload fields like that, you get an error status for each one.  A print_r($_FILES) on the completion of the upload of a file upload form with 3 files and a text field gives me this:

Array
(
    [file] => Array
        (
            [name] => Array
                (
                    [0] => Screenshot_1.png
                    [1] => colourmap.pdf
                    [2] => 
                )

            [type] => Array
                (
                    [0] => image/png
                    [1] => application/pdf
                    [2] => 
                )

            [tmp_name] => Array
                (
                    [0] => /var/tmp/phpERCmvY
                    [1] => /var/tmp/phpDJfvBw
                    [2] => 
                )

            [error] => Array
                (
                    [0] => 0
                    [1] => 0
                    [2] => 4
                )

            [size] => Array
                (
                    [0] => 162434
                    [1] => 239943
                    [2] => 0
                )

        )

)

The error array has 0, 0 and 4.  That means the first 2 file upload fields uploaded fine and the 3rd got an error code 4 which means "no file uploaded".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 01:01:28 2024 UTC