drumhrd Posted October 11, 2009 Share Posted October 11, 2009 hello all you wonderful php freaks. I am trying to setup an uploader. Content will be mp3. I am trying to get the mime type of the uploaded files in the form but I cannot seem to get it to work. $mime_type = mime_content_type($_FILES['userfile1']['tmp_name']); this results in an empty variable. I know php has that wonderful little function called getimagesize $imageinfo = getimagesize($_FILES['userfile1']['tmp_name']); which results in a $imageinfo['mime']. But of course I cannot use it on mp3 files. just trying to get some simular functionality. Thanks Quote Link to comment Share on other sites More sharing options...
jon23d Posted October 11, 2009 Share Posted October 11, 2009 I use apache_lookup_uri(), though for some reason it only seems to work on some servers, I haven't yet figured out why! Quote Link to comment Share on other sites More sharing options...
drumhrd Posted October 11, 2009 Author Share Posted October 11, 2009 I checked the php site for apache_lookup_uri() and don't see mime type listed as an object returned by this function. When user uploads a file..I need to check the mime type for audio/mpeg3 || audio/x-mpeg-3 I cannot figure out how to go about getting the mime type from the user uploaded file so I can check it before it is processed by move_uploaded_file Quote Link to comment Share on other sites More sharing options...
jon23d Posted October 11, 2009 Share Posted October 11, 2009 It is in the property content_type, but is the same as mime type. Quote Link to comment Share on other sites More sharing options...
drumhrd Posted October 11, 2009 Author Share Posted October 11, 2009 this is getting just what's passed in the http headers right...I want what's actually in the file header. I can manipulate the http headers with what ever mime type I want..this is not secure. Quote Link to comment Share on other sites More sharing options...
jon23d Posted October 11, 2009 Share Posted October 11, 2009 No, that is not the case. Did you read the manual? This has absolutely nothing to do with http headers... Quote Link to comment Share on other sites More sharing options...
drumhrd Posted October 11, 2009 Author Share Posted October 11, 2009 ok this seems to work..thanks for the help. 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.