This set of PHP Multiple Choice Questions & Answers (MCQs) focuses on “Uploading Files with PHP”.
1. Which directive determines whether PHP scripts on the server can accept file uploads?
Explanation: By default its value is on.
2. Which of the following directive determines the maximum amount of time that a PHP script will spend attempting to parse input before registering a fatal error?
Explanation: This is relevant because particularly large files can take some time to upload, eclipsing the time set by this directive.
3. What is the default value of max_input_time directive?
a) 30 seconds
b) 60 seconds
c) 120 seconds
d) 1 second
4. Since which version of PHP was the directive max_file_limit available.
a) PHP 5.2.1
b) PHP 5.2.2
c) PHP 5.2.12
d) PHP 5.2.21
Explanation: The max_file_limit directive sets an upper limit on the number of files which can be simultaneously uploaded.
5. What is the default value of the directive max_file_limit?
a) 10 files
b) 15 files
c) 20 files
d) 25 files
6. Which directive sets a maximum allowable amount of memory in megabytes that a script can allow?
Explanation: Its default value is 16M.
7. If you want to temporarily store uploaded files in the /tmp/phpuploads/ directory, which one of the following statement will you use?
a) upload_tmp_dir “/tmp/phpuploads/ directory”
b) upload_dir “/tmp/phpuploads/ directory”
c) upload_temp_dir “/tmp/phpuploads/ directory”
d) upload_temp_director “/tmp/phpuploads/ directory”
8. Which superglobal stores a variety of information pertinent to a file uploaded to the server via a PHP script?
a) $_FILE Array
b) $_FILEs Array
c) $_FILES_UPLOADED Array
d) $_FILE_UPLOADED Array
9. How many items are available in the $_FILES array?
Explanation: $_FILEs[‘userfile’][‘error’], $_FILEs[‘userfile’][‘name’], $_FILEs[‘userfile’][‘size’], $_FILEs[‘userfile’][‘tmp_name’], $_FILEs[‘userfile’][‘type’] are the five items in the array.
10. Which function is used to determine whether a file was uploaded?
Sanfoundry Global Education & Learning Series – PHP Programming.
To practice all questions on PHP Programming, here is complete set of 1000+ Multiple Choice Questions and Answers on PHP.