php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57375 APC upload feature fails if filesize larger than upload_max_filesize
Submitted: 2006-11-14 04:13 UTC Modified: 2014-02-28 12:37 UTC
Votes:5
Avg. Score:3.8 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: krudtaa at yahoo dot com Assigned: krakjoe (profile)
Status: Closed Package: APC (PECL)
PHP Version: 5.2.0 RC4 OS: Windows XP Pro
Private report: No CVE-ID: None
 [2006-11-14 04:13 UTC] krudtaa at yahoo dot com
Description:
------------
Actually using PHP 5.2.0

Regarding new upload feature for PHP 5.2 when using the APC extension.

If total upload filesize is above upload_max_filesize and post_max_size then upload progress meter will not work, because the "APC_UPLOAD_PROGRESS" object has not been stored in APC cache I belive, and the requested script will report back:

Notice: Undefined index: APC_UPLOAD_PROGRESS in PATH-TO-FILE\progress-custom.php on line 83



Reproduce code:
---------------
Take the source from:
http://progphp.com/progress.phps

then modify it so it does not use the YUI libs but your own javascript "AJAX" like calls to the server:

Then make sure the form is submitted to server the "normal" way.

Then submit enough files so total filesize gets above the value in upload_max_filesize and post_max_size (mine was set to 350M).

Note: I also tested the original script found here:
http://progphp.com/progress.phps on my own server the same way.... progress meter does not get updated, and after a while it just hangs.... but because of the use of YUI libs I do not get back the error message from the server script.


I used something like this for the "AJAX" like calls to server in my modified version:

numCheckUpdate=0;
function checkUpload(){
  numCheckUpdate+=1;
  var progress_key =  
    document.getElementById('progress_key').value;
  var url = 
"progress-custom-status.php?progress_key="+progress_key+"&counter="+numCheckUpdate;
			
  // Create new JS element
if( document.getElementById && document.childNodes && 
    document.createElement ) {
   var jsel = document.createElement('SCRIPT');
   jsel.type = 'text/javascript';
   jsel.src = url;
   // Append JS element (therefore executing the 'AJAX' 
      call)
   document.body.appendChild (jsel);
} else {
  alert("Your browser does not support this 
    feature!\n\nBrowsers that support it are: Explorer, 
    Firefox, Netscape, Opera, Safari 2.0");
}
}

Expected result:
----------------
The new upload extension in APC should create the APC object and set cancel_upload to a correct value.

It should do this pretty fast without having to wait for all the files to get uploaded before it do so.

Actual result:
--------------
No files seem to be created in php temp dir.

Progress meter not updated, probably because the APC upload feature fails to create the object in the cache.

Then after a while the requested script sends back this:

Notice: Undefined index: APC_UPLOAD_PROGRESS in C:\www\Apache2\htdocs\uploadtest\progress-custom.php on line 83

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-25 07:41 UTC] rasmus@php.net
This is technically not an APC bug as the file upload hooks are not called at all in this case.  I'll keep it here since I need to have a look at it in PHP.
 [2007-09-17 19:10 UTC] mail at picsent dot com
You can try to test it by using the uploader at http://www.picsent.com if you want. its problay the quickeest way.
 [2008-11-09 04:34 UTC] krudtaa at yahoo dot com
I have reported the bug here:
http://bugs.php.net/bug.php?id=46527
 [2014-02-28 12:37 UTC] krakjoe@php.net
-Status: Analyzed +Status: Closed -Assigned To: +Assigned To: krakjoe
 [2014-02-28 12:37 UTC] krakjoe@php.net
Closing this bug for several reasons:

 5.2 is no longer supported software.
 APC is no longer the primary means of caching opcodes.
 I wouldn't expect APC to be able to over-ride the servers settings anyway.

Thanks for helping to make PHP better :)
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat May 21 23:03:34 2022 UTC