【问题标题】:Uploadify not uploading after ~25MBUploadify在~25MB后不上传
【发布时间】:2012-05-15 02:34:07
【问题描述】:

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

我正在使用此功能报告上传状态:

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

如果我尝试上传任何小于 25MB 的文件,它可以正常工作,任何超过该大小的文件和上传都会停止。没有错误或任何东西。

这些是我的相关@​​987654322@ 设置:

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 找到任何东西。

谢谢。

【问题讨论】:

  • 你的max_execution_time是什么?
  • 30 秒,但被视为该站点位于 localhost 上,它本质上只是复制文件,没有上传超过此时间。事实上,它会在上传开始后不到一秒的时间内停止上传。

标签: jquery file-upload uploadify


【解决方案1】:

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

我只是这样做了:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-07-08
    • 2013-04-01
    • 2015-03-17
    • 2013-01-09
    • 2011-01-26
    • 1970-01-01
    • 2023-03-29
    • 1970-01-01
    相关资源
    最近更新 更多