视频文件不在php上传

时间:2014-05-16 12:53:09

标签: php

我已使用此代码在服务器上上传视频

 $target = "../images/video/"; 
 $target = $target . basename( $_FILES['file']['name']); 
 $pic='images/video/'.($_FILES['file']['name']); 
 //Writes the photo to the server 

 if(move_uploaded_file($_FILES['file']['tmp_name'], $target)) 
 { 
 }

我也试过这个

print_r($_FILES);

它的回馈

Array ( [file] => Array 
                 ( 
                   [name] => Ankhian Nu Ren De - Quratulain Balouch (Studio Version) [HD] - YouTube.mp4 
                   [type] => [tmp_name] => 
                   [error] => 1 
                   [size] => 0 
                 ) 
   ) 

告诉我这是什么问题

1 个答案:

答案 0 :(得分:1)

来自the manual

UPLOAD_ERR_INI_SIZE
Value: 1; The uploaded file exceeds the upload_max_filesize directive in php.ini.

基本上,文件太大了。您需要更改设置以允许更大的文件上传。在php.ini文件中设置upload_max_filesizepost_max_size的值:

; Maximum allowed size for uploaded files.
upload_max_filesize = 120M

; Must be greater than or equal to upload_max_filesize
post_max_size = 120M

如果您有使用ini_set() most likely will not work的共享主机。但你可以尝试使用.htaccess(但这可能不会起作用):

php_value upload_max_filesize 120M
php_value post_max_size 120M