0

So I am working in an api that accepts a base 64 encoded file's contents. There is an attribute for file type but apparently the client is sending a file that doesn't match the file type. The file name is irrelevant, they do not send one.

Is there a way to determine the mime type of the file being sent after I decode the file contents?

echoBr00tal
  • 67
  • 1
  • 10
  • What have you tried? http://php.net/manual/en/function.mime-content-type.php ? – Roy Aug 15 '16 at 15:23
  • This will not work, right? I need to get the mime type from the source of the file (the contents) not the file name. – echoBr00tal Aug 15 '16 at 15:26
  • Right, you may want to find the content-type of the file. http://stackoverflow.com/questions/1232769/how-to-get-the-content-type-of-a-file-in-php – Roy Aug 15 '16 at 15:32

0 Answers0