Error in file uploading in php

前端 未结 3 1265
执念已碎
执念已碎 2021-01-29 16:50

My HTML code

相关标签:
3条回答
  • 2021-01-29 16:57

    The ini_set function is

    ini_set("max_filesize","150M");
    
    0 讨论(0)
  • 2021-01-29 17:07

    It looks like for video files, the file size is too large (126 MB, as reported by OP). So the PHP script is never receiving the file.

    There are a few places where you can look to adjust this. First, you can set a max file size in the HTML form:

    <input type="hidden" name="MAX_FILE_SIZE" value="157286400" /> <!-- 150 MB -->
    

    Also, you may need to adjust some variables in you php.ini file:

    http://www.cyberciti.biz/faq/linux-unix-apache-increase-php-upload-limit/

    0 讨论(0)
  • 2021-01-29 17:10

    You need to check if a variables available before you can start working on it and its obvious you need some basic on on how to work with $_FILES please see http://php.net/manual/en/reserved.variables.files.php

    <?php
    
    if (isset ( $_FILES ['image'] )) {
        $extension = pathinfo ( $_FILES ['image'] ['name'], PATHINFO_EXTENSION );
        echo $extension;
    }
    
    ?>
    
    <form method="post" enctype="multipart/form-data" action="">
        <input type="file" name='image'> <input type="SUBMIT" value="Submit">
    </form>
    
    0 讨论(0)
提交回复
热议问题