0

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.

Marcel Korpel
  • 21,536
  • 6
  • 60
  • 80
jpicaude
  • 356
  • 2
  • 8
  • are you using a system path or a relative path? – Drixson Oseña Dec 07 '13 at 12:25
  • File file paths are absolute, given by symfony mechanisms. – jpicaude Dec 07 '13 at 12:28
  • Lack of diskspace? Especially if `/tmp` is mounted on a smaller partition. Try copying the file to `/tmp` then moving it manually as the PHP user, see what happens. – soulseekah Dec 07 '13 at 13:51
  • 2To free... that's not it. The upload_tmp_dir is especially mounted on a special partition. I found a solution to my problem, which is not very good but since move_uploaded_file doesn't work, I can't figure out how to make it another way. Just replaced move_uploaded_file with rename .... – jpicaude Dec 08 '13 at 19:48

0 Answers0