To do this exercise,
- create a fork of this repo
- add code as explained below
- submit the link to this repo to the assignments email address
- give a subject of this repo's name and the version number
Complete the uploadhandler, use either the easy or hard, and change your uploadform to use that file
- follow the comments and create code to complete it.
- Uploadhandler will check for file type match, file size, and existing file -PHP functions will likely include:
- mysqli_connect
- mysqli_query
- json_encode
- pathinfo
- strlen
- empty
- isset
- move_uploaded_file
- file_exists
- in_array
- session_start
- session_destroy
A note about file permissions:
It may be necessary to change the permissions on your uploads directory to allow files to be written to it. For the purposes of this exercise, you can do the following in either OSX terminal or Windows Git Bash (a straight Windows version does exist, too)
chmod 777 uploads
Changing directly to 777 permanently is not normally advisable for anything public facing!