Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 带有APC和Codeigniter的进度条-IE和Chrome出现故障_Javascript_Codeigniter_Upload_Progress Bar_Apc - Fatal编程技术网

Javascript 带有APC和Codeigniter的进度条-IE和Chrome出现故障

Javascript 带有APC和Codeigniter的进度条-IE和Chrome出现故障,javascript,codeigniter,upload,progress-bar,apc,Javascript,Codeigniter,Upload,Progress Bar,Apc,我正在尝试用Codeigniter和APC制作一个进度条 这是我的表格: <form method="post" action="" id="upload_file" enctype="multipart/form-data" target="result_frame"> <input type="hidden" value="<?php echo uniqid(); ?>" id="progress_key" name="APC_UPLOAD_PROGRESS"

我正在尝试用Codeigniter和APC制作一个进度条

这是我的表格:

<form method="post" action="" id="upload_file" enctype="multipart/form-data" target="result_frame">

<input type="hidden" value="<?php echo uniqid(); ?>" id="progress_key" name="APC_UPLOAD_PROGRESS" />

<p><label for="userfile">S&eacute;l&eacute;ctionnez un fichier</label><br />
<input type="file" name="userfile" id="userfile" size="20" />
&nbsp;
<button class="btn btn-primary" type="submit" name="submit" id="submit" value="Submit"><span class="icon-upload"></span>&nbsp;Valider</button></p>  
因此,当用户单击“提交”时,他的文件被上传(我使用编写上传函数),并且在1.5秒后调用函数checkProgress

使用Firefox,一切都很好。我得到了正确的值,进度条的行为符合我的要求。对于IE和Chrome,它不能正常工作:对于“进度”值,IE总是返回420和Chrome 410。所以,上传过程好像已经完成了,但还没有完成。顺便说一下,这些值​​与文件大小或其他内容不对应。我不明白Firefox怎么可能计算并返回正确的值,而不是其他浏览器

使用FIREFOX: 镀铬: 在我的php.ini中,我有以下内容:

extension=php_apc.dll

[APC]
apc.enabled = 1
apc.max_file_size = 5000M
apc.rfc1867 = On
apc.mmap_file_mask = C:\wamp\tmp\file_template_%s.tmp
apc.shm_segments = 1
apc.shm_size = 64M
apc.stat=1
有人有什么建议吗?非常感谢。
谢谢

我认为这是一个IE缓存问题

尝试使用
cache
标记
$.ajax
请求参数,设置
false
或/并向请求添加时间戳

function checkProgress() {

    $.ajax({
        type  : "POST",
        url   : "/fbe_upload/index.php/fbeupload/upload_progress?t=" + (new Date().getTime()),
        cache : false,
    // ....
并为
/fbe\u upload/index.php/fbeupload/upload\u progress
路由添加无缓存头

header('Expires: Tue, 08 Oct 1991 00:00:00 GMT');
header('Cache-Control: no-cache, must-revalidate');

你确定chrome和ie发送了正确的会话吗?如果是,请求是否可能被缓存?尝试在请求后附加一个时间戳,看看是否得到不同的结果。没有更多的信息/某种形式的fiddle@LancelotKiin你找到答案了吗?如果没有,我将尝试帮助您。尝试在
$处添加。ajax
param
cache:false
Array
(
    [total] => 410
    [current] => 410
    [rate] => 22777015.099338
    [filename] => 
    [name] => userfile
    [cancel_upload] => 4
    [done] => 1
    [start_time] => 1370864408.3726
)
extension=php_apc.dll

[APC]
apc.enabled = 1
apc.max_file_size = 5000M
apc.rfc1867 = On
apc.mmap_file_mask = C:\wamp\tmp\file_template_%s.tmp
apc.shm_segments = 1
apc.shm_size = 64M
apc.stat=1
function checkProgress() {

    $.ajax({
        type  : "POST",
        url   : "/fbe_upload/index.php/fbeupload/upload_progress?t=" + (new Date().getTime()),
        cache : false,
    // ....
header('Expires: Tue, 08 Oct 1991 00:00:00 GMT');
header('Cache-Control: no-cache, must-revalidate');