Php歌曲上传

时间:2012-03-23 18:38:24

标签: php upload

我正在尝试上传一首带有html表单和php代码的歌曲。 我已经找到了脚本的净负载,但似乎没有人做这项工作。 我的意思是,它实际上传了一些小图片,但是当它上传大文件(甚至可能是图像和歌曲)时,它会显示错误1。 这是我用过的代码:

<!-- The data encoding type, enctype, MUST be specified as below -->
<form enctype="multipart/form-data" action="uploader.php" method="POST">
<!-- MAX_FILE_SIZE must precede the file input field -->
<input type="hidden" name="MAX_FILE_SIZE" value="" />
<!-- Name of input element determines name in $_FILES array -->
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>

其他文件:

<?php


$uploaddir = '';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);

echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Possible file upload attack!\n";
}

print_r($_FILES);

print "</pre>";


?>

问题是,即使我更改了name =“MAX_FILE_SIZE”中的值=“”=“”/&gt;我无法上传那些“大”文件。 我已经将php.ini文件中的值更改为20M

1 个答案:

答案 0 :(得分:0)

错误消息说明

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

http://php.net/manual/en/features.file-upload.errors.php