lucan Posted February 26, 2011 Share Posted February 26, 2011 I am looking to allow people to also upload pdf and doc ad txt files can you show me how to convert this script . Thanks. [code=php:0] // Check to see if the type of file uploaded is a valid image type function is_valid_type($file) { // This is an array that holds all the valid image MIME types $valid_types = array("image/jpg", "image/jpeg", "image/bmp","image/gif"); if (in_array($file['type'], $valid_types)) return 1; return 0; } [/code] Quote Link to comment Share on other sites More sharing options...
Krash Posted February 26, 2011 Share Posted February 26, 2011 Go here - http://snipplr.com/view/1937/array-of-mime-types/ Add the mime types you need to your $valid_types array. Quote Link to comment Share on other sites More sharing options...
lucan Posted February 26, 2011 Author Share Posted February 26, 2011 Thank you it worked Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.