TGWSE_GY Posted April 24, 2009 Share Posted April 24, 2009 Hi Guys, I am wondering if anyone knows of any decent tutorials on using PHP to allow users to upload images to their accounts and managing the files for retrieval. I am finding this one of the most frustrating of topics, simply for it complexity especially since I am a beginner moving into intermediate topics. Thanks Guys!!!!! Quote Link to comment https://forums.phpfreaks.com/topic/155438-in-need-of-advice-on-user-image-management/ Share on other sites More sharing options...
mikesta707 Posted April 24, 2009 Share Posted April 24, 2009 This is a very good basic file upload tutorial http://www.tizag.com/phpT/fileupload.php below is a little snippet that would deny certain file extensions $tmpp = explode ( '.', $_FILES['file']['name']); $fileext = $tmpp[count($tmpp)-1]; $allowedexts = array("mp3", "jpg", "bmp", "wav", "gif", "png", "jpeg", "wma" ); $imgexts = array("jpg", "bmp", "gif", "png", "jpeg" ); $muext = array("mp3", "wav", "wma" ); if (in_array($fileext, $allowedexts)){ if (in_array($fileext, $imgexts)){ $filetype1 = "art"; } if (in_array($fileext, $muext)){ $filetype1 = "music"; } } else { print "File not trusted!"; exit(); } hope that helps! Quote Link to comment https://forums.phpfreaks.com/topic/155438-in-need-of-advice-on-user-image-management/#findComment-817951 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.