用php上传文件并显示其内容

时间:2018-07-29 20:07:37

标签: php html

我想上传文件并在ubuntu的php中显示所有文件内容

我已将此代码编写在upload.html

    <html>
        <body>
            <form method="POST" action="upload.php" 
    enctype="multipart/form-part">
                <input type="file" name="file">
                <button type="submit" name="submit">Upload</button>
            </form>
        </body>
    </html>  

and this in upload.php

<?php 
if(isset($_POST['submit']))
{
   $file = $_FILES['file'];
   print_r($file);   
} 

its giving me an error 

注意:未定义的索引:第5行/var/www/html/form/upload.php中的文件它不能识别“文件”。...为什么?

0 个答案:

没有答案
相关问题