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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.