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] Link to comment https://forums.phpfreaks.com/topic/228863-doc-and-pdf-upload-files-help/ 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. Link to comment https://forums.phpfreaks.com/topic/228863-doc-and-pdf-upload-files-help/#findComment-1179820 Share on other sites More sharing options...
lucan Posted February 26, 2011 Author Share Posted February 26, 2011 Thank you it worked Link to comment https://forums.phpfreaks.com/topic/228863-doc-and-pdf-upload-files-help/#findComment-1179940 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.