Jump to content

Uploader?


cpugeek

Recommended Posts

I am learning PHP ,and I am making a file uploader ,and I only want the following files allowed:

  • .jpeg .jpe .gif .tiff .tif .png

The reason for the uploader is for a photo website gallerynote: the file should be restricted to 2 megabytes *any help appreciated :)

Link to comment
Share on other sites

Try looking here http://www.w3schools.com/php/php_file_upload.asp. There is a line there that grabs the content-type of the uploaded file:

$_FILES["file"]["type"]

You could check that value against a list of acceptable file types and decide whether or not you want to save the file or discard it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...