Jump to content

upload


Sami

Recommended Posts

How can I make my wetsite know what kind of file the user are uploading by filename instead of MIME?Because, when I should upload an mp3 file, the MIME type was "application/force-download"!

Link to comment
Share on other sites

The original file name is in the file data array with the array index 'name'.So if for example your file upload field is called "myfile", you can get the original file name as $_FILES['myfile']['name'].Once you've got this then getting the extension is easy enough, either by using the pathinfo() function, or parsing the name yourself.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...