National_Instruments
200-500 · Question #134
200-500 Question #134: Real Exam Question with Answer & Explanation
Sign in or unlock 200-500 to reveal the answer and full explanation for question #134. The question stem and answer options stay visible for context.
Question
An HTML form contains this form element: <input type="file" name="myFile" /> When this form is submitted, the following PHP code gets executed: 1 <?php 2 move_uploaded_file( 3 $_FILES['myFile']['tmp_name'], 4 'uploads/' . $_FILES['myFile']['name']); 5 ?> Which of the following actions must be taken before this code may go into production? (Choose 2)
Options
- ACheck with is_uploaded_file() whether the uploaded file $_FILES['myFile']['tmp_name'] is valid
- BSanitize the file name in $_FILES['myFile']['name'] because this value is not consistent among
- CCheck the charset encoding of the HTTP request to see whether it matches the encoding of the
- DSanitize the file name in $_FILES['myFile']['name'] because this value could be forged
- EUse $HTTP_POST_FILES instead of $_FILES to maintain upwards compatibility
Unlock 200-500 to see the answer
You've previewed enough free 200-500 questions. Unlock 200-500 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.