How to get the file path in html <input type=“file”> in PHP?

后端 未结 3 1074
[愿得一人]
[愿得一人] 2020-12-02 02:04

Can somebody pls tell me how to get the filepath using html in PHP?

Here are my codes:

index.php

3条回答
  •  天命终不由人
    2020-12-02 02:44

    I think you would gain a lot from taking a look at the following link: POST method uploads.

    First of all, you should change your form method to post, and add enctype="multipart/form-data".

    Then you can get the temporary file path from $_FILES['csv_file']['tmp_name'].

提交回复
热议问题