Simple PHP/HTML upload page - no files are saving

前端 未结 3 840
心在旅途
心在旅途 2021-01-26 06:09

I\'m new to HTML/PHP and I\'m trying to create a simple php file upload page. I have this as my HTML





相关标签:
3条回答
  • 2021-01-26 06:43

    With the PHP function move_uploaded_file(string $filename, string $destination) you can move the file to your desired path.

    0 讨论(0)
  • 2021-01-26 06:44

    You must add this snippet of code:

    move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file);
    

    after that:

    echo "File is an image - " . $check["mime"] . ".";
    
    0 讨论(0)
  • 2021-01-26 06:56

    You need to move the uploaded file from the temp directory it was uploaded into, into your target directory. See the PHP docs of move_uploaded_files

    0 讨论(0)
提交回复
热议问题