seeya Posted February 20, 2008 Share Posted February 20, 2008 asking this behalf on my friend.. does anyone know how i could get this? like example.. i want a visitor to upload a .jpg or .gif file onto my server, how do i set the "file of type" to only .jpg or .gif? Link to comment https://forums.phpfreaks.com/topic/92024-file-upload-with-specify-extension/ Share on other sites More sharing options...
priti Posted February 20, 2008 Share Posted February 20, 2008 hi, $_FILES['userfile']['type'] can help you to find the type of file NOTE: The mime type of the file, if the browser provided this information. An example would be "image/gif". This mime type is however not checked on the PHP side and therefore don't take its value for granted. Regards Link to comment https://forums.phpfreaks.com/topic/92024-file-upload-with-specify-extension/#findComment-471331 Share on other sites More sharing options...
seeya Posted February 20, 2008 Author Share Posted February 20, 2008 hi sorry.. i dont understand.. is it possible for u to create a form and the action for me to understand? sorry and thanks Link to comment https://forums.phpfreaks.com/topic/92024-file-upload-with-specify-extension/#findComment-471334 Share on other sites More sharing options...
priti Posted February 20, 2008 Share Posted February 20, 2008 well you can google for file upload there is a very good article oon this on tizag i think.just googleit they have a nice article on it. For more read http://pear.php.net/package/MIME_Type/docs this would be more helpful.But,first understand the basic file upload in PHP. regards Link to comment https://forums.phpfreaks.com/topic/92024-file-upload-with-specify-extension/#findComment-471335 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.