UNC
School of Information and Library Science
INLS760 – Web Databases, Spring 2009
INLS 760

Main Page

Announcements

Calendar/Notes

Assignments

Links

Course Policies

Grades

In-Class Exercise #4

File Upload

In this exercise, you will use PHP's file upload support to create a simple interface for uploading a picutre and a caption.

Create a two files, ex4.html and ex4.php that do the following:

  • ex4.html -- This html file should display a form with fields for a user to enter a caption and to browse for a picture to upload. The form action should be to call ex4.php. Use POST for the form submission.

  • ex4.php -- This php file should perform all the error and safety checks we discussed in class for file upload. Only accept image/jpeg. Create a new filename and save the file in tmp and make the new file world-readable.

    Keep in mind that any images uploaded will be put in tmp and will be world-readable. If you need an image to use, there are many free ones at: http://commons.wikimedia.org/wiki/Category:PD_US