douqiang5933 2012-03-23 18:38
浏览 14

Php歌曲上传

i'm trying to upload a song with an html form and a php code. I've found on the net loads of scripts but noone seems to do the work. I mean, it actually uploads little images but when it comes to upload big files (that can be even images and songs) it shows error 1. Here it's the code i've used:

<!-- 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>

OTHER FILE:

<?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.
";
} else {
echo "Possible file upload attack!
";
}

print_r($_FILES);

print "</pre>";


?>

the problem is that even if i change the value in name="MAX_FILE_SIZE" value="" /> i can't upload those "big" files. I've already changed the value in the php.ini file to 20M

  • 写回答

1条回答 默认 最新

  • douduan7295 2012-03-23 18:56
    关注

    Error Messages Explained

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

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

    评论

报告相同问题?

悬赏问题

  • ¥15 任务A:大数据平台搭建(容器环境)怎么做呢?
  • ¥15 r语言神经网络自变量重要性分析
  • ¥15 基于双目测规则物体尺寸
  • ¥15 wegame打不开英雄联盟
  • ¥15 公司的电脑,win10系统自带远程协助,访问家里个人电脑,提示出现内部错误,各种常规的设置都已经尝试,感觉公司对此功能进行了限制(我们是集团公司)
  • ¥15 救!ENVI5.6深度学习初始化模型报错怎么办?
  • ¥30 eclipse开启服务后,网页无法打开
  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?
  • ¥15 STM32单片机自主设计