200-710 Exam QuestionsBrowse all questions from this exam

200-710 Exam - Question 10


SIMULATION -

Which PHP function is used to validate where the contents of $_FILES[name][tmp_name] have really been uploaded via HTTP, and also save the contents into another folder?

Show Answer
Correct Answer:

The correct function to validate whether the contents of \\$_FILES[name][tmp_name] have really been uploaded via HTTP and also save the contents into another folder is move_uploaded_file(). The move_uploaded_file() function checks if the file is a valid upload (i.e., it was uploaded via PHP's HTTP POST method) and, if valid, moves it to the specified destination. The is_uploaded_file() function only validates the uploaded file but doesn't move it.

Discussion

3 comments
Sign in to comment
ZhukovPeter
Jan 4, 2020

I think answer should be move_uploaded_file. From manual: This function checks to ensure that the file designated by filename is a valid upload file (meaning that it was uploaded via PHP's HTTP POST upload mechanism). If the file is valid, it will be moved to the filename given by destination.

[Removed]
Jun 20, 2020

the answer should be : move_uploaded_file

stefanospetrakis
Nov 11, 2020

Dito, this should be move_uploaded_file()