PHP Programming Basics Practice Test: Uploading Files with PHP — Flashcards | PHP & Programming | FatSkills

PHP Programming Basics Practice Test: Uploading Files with PHP — Flashcards

Fast review mode: answers are shown by default so you can skim quickly. Hide them if you want to self-test.

To upload files using PHP, you can:
Configure the php.ini file to allow file uploads
Use an HTML form with a method attribute set to post and an ` enctype` attribute set to multipart/form-data
Use a `file <input> element to specify the file to upload
Use the multidimensional $_FILES array to access information about the file upload
Use the information in the $_FILES array to move the file from the temporary directory to the desired location 

When a file is uploaded, it's saved as a temporary file, and the full path to this file is in the temp name element. Once uploaded, you need to move this file to a more permanent location. The original file name is in the name element. 
Here are some other things you can do: Check if the file already exists, Limit file size, Limit file type, Access information about the uploaded files using file super global, and Check for error code constants. 

1 of 10 Ready
Which directive determines whether PHP scripts on the server can accept file uploads?
file_uploads
Shortcuts
Prev Space Show / hide Next
Turn this into a study set.
Sign in with Google to save tricky questions to your reminder list and resume on any device.
Sign in with Google Free • no extra password