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? Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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 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.