|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-04-04 04:38 UTC] pecl at neuveglise dot net
Description:
------------
File upload are not tracked with APC on Debian Etch (PHP
Version 5.2.0-8+etch10)
phpinfo :
APC Support enabled
Version 3.0.18
MMAP Support Enabled
MMAP File Mask no value
Locking type pthread mutex Locks
Revision $Revision: 3.154.2.2 $
Build Date Apr 4 2008 10:22:31
Directive Local Value Master Value
apc.cache_by_default On On
apc.coredump_unmap Off Off
apc.enable_cli Off Off
apc.enabled On On
apc.file_update_protection 2 2
apc.filters no value no value
apc.gc_ttl 3600 3600
apc.include_once_override Off Off
apc.max_file_size 1M 1M
apc.mmap_file_mask no value no value
apc.num_files_hint 1000 1000
apc.report_autofilter Off Off
apc.rfc1867 On On
apc.rfc1867_freq 0 0
apc.rfc1867_name APC_UPLOAD_PROGRESS
APC_UPLOAD_PROGRESS
apc.rfc1867_prefix upload_ upload_
apc.shm_segments 1 1
apc.shm_size 30 30
apc.slam_defense 0 0
apc.stat On On
apc.stat_ctime Off Off
apc.ttl 0 0
apc.user_entries_hint 4096 4096
apc.user_ttl 0 0
apc.write_lock On On
Reproduce code:
---------------
<form enctype="multipart/form-data" target="tfrm" action="index.php" method="post" onsubmit="attendEnvoie();">
<input type="hidden" name="APC_UPLOAD_PROGRESS" id="progress_key" value="<?php echo uniqid()?>">
<input type="file" id="test_file" name="test_file"><br>
<input type="submit" value="Upload!">
<input type="button" onclick="annule();" value="Annule">
</form>
if (isset($_GET['progress_key'])) {
$rep=apc_fetch('upload_'.$_GET['progress_key']);
echo json_encode($rep);
exit;
Expected result:
----------------
$rep to be filled with proper values
Actual result:
--------------
fals
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 14:00:01 2025 UTC |
further testing.. I switched over to apache to test, same issue: What happens is as follows: 1) I start polling apc every 100ms for the file upload status. Obviously, the first few apc_fetch('upload_' . $id) return false which is fine. 2) I submit the upload ( through hidden iframe ) 200 milliseconds later. 3) It seems that only once the upload is complete, does apc_fetch('upload_' . $id) return back a valid upload status, where total === current, i.e. the upload is done ( as others have said above). Server version: Apache/2.0.52 Architecture: 32-bit Server compiled with.... -D APACHE_MPM_DIR="server/mpm/prefork" -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_SYSVSEM_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D HTTPD_ROOT="/etc/httpd" -D SUEXEC_BIN="/usr/sbin/suexec" -D DEFAULT_PIDLOG="logs/httpd.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_LOCKFILE="logs/accept.lock" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="conf/mime.types" -D SERVER_CONFIG_FILE="conf/httpd.conf"I have the same problems!! System: Ubuntu 8.04 it checks the file that i uploaded before file i am uploading right now. So it return $status['done'] at the first time. print_r looks like this: {"total":4037,"current":4037,"rate":63324372.0037,"filename":"rtor.rc","name":"myFile","temp_filename":"\/tmp\/phplNAPZm","cancel_upload":0,"done":1,"start_time":1240072203.55} but it check rtor.rc but at the time i am uploading screenshoot.png for example.. :( so the bug is stell here?Got the same problem, entry is created when the file upload is complete. Using lighttpd 1.4.22 (1 Thread), php5-cgi and php-apc or latest CVS code. Upload: ---------- <form enctype="multipart/form-data" action="upload.php" method="POST"> <input type="hidden" name="APC_UPLOAD_PROGRESS" value="<?php echo $unique_id?>" /> Send this file: <input name="userfile" type="file" /> <input type="submit" value="Send File"> </form> ---------- Progress: ---------- <?php print_r(apc_fetch('upload_'.$_GET['progress_key'])); ?> ---------- APC: ---------- Version 3.1.2 MMAP Support Enabled MMAP File Mask no value Locking type pthread mutex Locks Revision $Revision: 3.222 $ Build Date May 17 2009 21:43:51 ... apc.rfc1867 On apc.rfc1867_freq 0 apc.rfc1867_name APC_UPLOAD_PROGRESS apc.rfc1867_prefix upload_ ... ----------The issue seems to be that $status = apc_fetch('upload_' . $key); is always returning FALSE.