视频不会上传 [英] Videos won't upload
问题描述
我正在尝试使用 PHP 上传一些视频.但我无法将它们放入任何文件夹.我没有收到错误,所以我不知道从哪里开始.
我的代码:
$tmp_name) {move_uploaded_file($tmp_name, "upload/{$_FILES['files']['name'][$key]}");}}?><!DOCTYPE html><头><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>上传视频</title>头部><身体><div><form action="" method="post" enctype="multipart/form-data"><p><input type="file" name="files[]" multiple="multiple" min="1" max="9999"/><输入类型=提交"值=上传"/></p></表单>
</html>
我正在尝试上传 .webm、.ogv 和 .mp4文件不是那么大,它们只有 5MB 之类的.首先,我在 Apache 日志中收到此错误:15236606 字节的 POST Content-Length 超出了 8388608 的限制.所以我将该限制从 8MB 更改为 80MB,现在该错误消失了,但文件尚未上传.而且没有错误了.当我尝试发送一些图像时,我得到了它们.可能有些事情没有正确处理.但我不知道是什么.
预先感谢您的帮助;)
比约恩
您需要进行以下设置:
post_max_size上传最大文件大小内存限制
还要将 set_time_limit
设置为较高的值.
I'm trying to upload some videos using PHP. But I can't get them into any folder. I don't get errors, so I don't know where to start.
My code:
<?php
if(isset($_FILES['files']))
{
foreach ($_FILES['files']['tmp_name'] as $key => $tmp_name) {
move_uploaded_file($tmp_name, "upload/{$_FILES['files']['name'][$key]}");
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Uploading videos</title>
</head>
<body>
<div>
<form action="" method="post" enctype="multipart/form-data">
<p>
<input type="file" name="files[]" multiple="multiple" min="1" max="9999" />
<input type="submit" value="Upload" />
</p>
</form>
</div>
</body>
</html>
I'm trying to upload, .webm, .ogv and .mp4 The files aren't that big, they're just 5MB or something. First I got this error in Apache log: POST Content-Length of 15236606 bytes exceeds the limit of 8388608. So I changed that limit from 8MB to 80MB and now that error is gone, but the files aren't uploaded yet. And there are no errors anymore. When I try to send some images, I get them. Probably there is something not handled correctly. But I don't know what.
Thanks in advance for the help ;)
Bjorn
You'll want to up the following settings:
post_max_size
upload_max_filesize
memory_limit
Also set_time_limit
to something high as well.
这篇关于视频不会上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!