cpugeek Posted September 24, 2006 Share Posted September 24, 2006 I am learning PHP ,and I am making a file uploader ,and I only want the following files allowed: .jpeg .jpe .gif .tiff .tif .pngThe 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 More sharing options...
jesh Posted September 25, 2006 Share Posted September 25, 2006 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now