PHP $_FILES['file']['tmp_name']: How to preserve filename and extension?

后端 未结 6 1116
谎友^
谎友^ 2020-12-09 16:25

I am trying to upload a doc file from a form and send it to email. I am using

$_FILES[\'file\'][\'tmp_name\'];

The problem is, it is retur

6条回答
  •  有刺的猬
    2020-12-09 17:01

    $_FILES["file"]["tmp_name"] contains the actual copy of your file content on the server while
    $_FILES["file"]["name"] contains the name of the file which you have uploaded from the client computer.

提交回复
热议问题