dongzhong8834 2013-12-07 12:23
浏览 40

尽管我的文件已正确上传,move_uploaded_file仍无法正常工作

I'm stuck with a strange bug which I can't understand. Here's the background :

I set up a form to upload video files whose size can vary from 2M up to 6G. The file is uploaded then moved via mode_uploaded_file after some DB recordings (the $media variable is an object representing the media, and $fichier is an alias to $_FILES) :

$destination_dir  = sfConfig::get($media instanceof Image ? 'app_snapshot_dir' : 'app_wowza_content_dir');
$destination_file = $destination_dir . '/' . preg_replace('/^(.+)\.(.+)$/', ('${1}' . ($media->isImage() ? '' : '_base') . '.${2}'), Media::standardize($media->getFSFileName($fichier['name'])));
$deplacement      = move_uploaded_file($fichier['tmp_name'], $destination_file); // Here I get false, without any additional errors.

The script works perfectly if I send files up to 700M, but the move_uploaded_file part returns false (but no additional info) when the file is bigger.

Obviously, I set my php.ini directives accordingly :

upload_max_filesize = 12G
post_max_size = 12G
max_input_time = 0
max_execution_time =0

But the problem remains : the temp file is here, but it's not moved. PHP is running with PHP-FPM, and checked the destination folder, which has the perms 2777 and is owned by the user running the php-fpm process.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥60 求一个简单的网页(标签-安全|关键词-上传)
    • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
    • ¥15 基于卷积神经网络的声纹识别
    • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP