Jump to content

upload mime type (non-image) checker


drumhrd

Recommended Posts

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

 

 

Link to comment
https://forums.phpfreaks.com/topic/177293-upload-mime-type-non-image-checker/
Share on other sites

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.