PHP File Upload Help

前端 未结 4 378
被撕碎了的回忆
被撕碎了的回忆 2021-01-29 12:27
File Upload
相关标签:
4条回答
  • 2021-01-29 12:40

    move_uploaded_file() requires a $destination parameter as it's second argument. This should be set to the path at which you want to save the file.

    0 讨论(0)
  • 2021-01-29 12:42

    it should be tmp_name

    if (isset($_FILES['file']) && move_uploaded_file($_FILES['file']['tmp_name'],'ftp/' . $_FILES['file']['name']))
    

    and do not send it as GET

    <form enctype="multipart/form-data" action = "fileupload.php" method = "post">
    

    (changed get to post)

    0 讨论(0)
  • 2021-01-29 12:55

    You cannot send the file through $_GET. You should use POST as your method for the form.

    0 讨论(0)
  • 2021-01-29 12:59

    I'm guessing you would need to supply a destination in the move-uploaded-file function as an argument. If the move to the destination (in this case non-existent) cannot be accomplished, it would return false, which is why it would go to your else{} condition.

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