Exam 200-710 All QuestionsBrowse all questions from this 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?

    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
ZhukovPeter

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.

stefanospetrakis

Dito, this should be move_uploaded_file()

[Removed]

the answer should be : move_uploaded_file