search

Home  >  Q&A  >  body text

Why is the file $_FILE uploaded by phpstudy always empty (I am using phpStudy)

<!DOCTYPE>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html;
     charset=UTF-8"
    >
    <title>this is my fileuUpload</title>
</head>
<body>
    <form action="doAction.php" method="post"
          enctype="multipart/form-data">
        请选择你要上传的文件
        <input type="file" name="myfile"/><br/>
        <input type="submit" value='上传文件'/><br/>
    </form>
</body>

</html>

<?php
/**

//$_FILES

print_r($_FILES);

巴扎黑巴扎黑2757 days ago532

reply all(1)I'll reply

  • 世界只因有你

    世界只因有你2017-05-19 10:09:31

    I guess the size of the file you uploaded exceeds the configuration size in PHP. The default is 2M. You can try uploading a file smaller than 2M. If it is OK, try changing the configuration to a larger size. Also, the received file is $_FILES instead of $_FILE.

    reply
    0
  • Cancelreply