Videos won't upload

拥有回忆 提交于 2019-12-08 07:44:51

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/8402139/videos-wont-upload

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!