2012-05-14 45 views
0

我在本地主机上使用Uploadify来开发用户可以上传文件的网站。到目前为止,一切正常,但Uploadify拒绝上传任何超过〜25MB的文件。〜25MB后uploadify无法上传

我使用这个功能报告上载状态:

function updateProgress(file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBytesTotal) { 
    var percent = totalBytesUploaded/totalBytesTotal * 100; 
    $('.bar').css('width', percent + '%'); 
    console.log(percent +' ' + bytesUploaded); 
} 

如果我尝试上传,根据25MB的大小,它工作正常,任何文件上面,并上传刚刚停止的任何文件。没有错误或任何东西。

这些都是我的相关php.ini设置:

post_max_size = 1024M 
upload_max_filesize = 1000M 
memory_limit = 1024M 

,我已经证实,他们正在使用phpinfo()正确。这是我的上传脚本:

<?php 
$targetFolder = '/uploads'; // Relative to the root 

if (!empty($_FILES)) { 
    $tempFile = $_FILES['Filedata']['tmp_name']; 
    $targetPath = $_SERVER['DOCUMENT_ROOT'] . $targetFolder; 
    $targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name']; 

    $fileParts = pathinfo($_FILES['Filedata']['name']); 

    move_uploaded_file($tempFile,$targetFile); 
    echo '1'; 
} 
?> 

有什么,我在这里错过了吗?也许是Apache配置设置? Uploadify文档对此错误的帮助不大,我似乎无法通过Google找到任何内容。

谢谢。

+1

什么是你'max_execution_time'? – MetalFrog

+0

30秒,但看到该网站是在本地主机上,它基本上只是复制文件没有上载过去。事实上,在上传开始后,它会在一秒钟内停止上传。 –

回答

0

发现此问题。我将jQuery效果fadeOut应用于表单,该表单在动画结束时将表单样式设置为display: none。当表单到达此Uploadify时停止上传。

我只是这样做,而不是:

$('#upload-form').animate({opacity: 0}, function() { 
    /// whatever 
}