CodeIgniter Forums
$_FILES['userfile']['type'] Mime type different than the $this->upload->data() mine type? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: $_FILES['userfile']['type'] Mime type different than the $this->upload->data() mine type? (/showthread.php?tid=60957)

Pages: 1 2


$_FILES['userfile']['type'] Mime type different than the $this->upload->data() mine type? - El Forum - 08-12-2014

[eluser]InsiteFX[/eluser]
You can check it the way you are now just ignore the application/octet-stream.

Otherwise you will need to send an header for the file type.

Pure php file upload

Shows how to check for the file type on upload.



$_FILES['userfile']['type'] Mime type different than the $this->upload->data() mine type? - El Forum - 08-13-2014

[eluser]Patche[/eluser]
Hi,

Thanks for your reply.

That link shows that it's checking the file type using the $_FILES[]['type'] array- which is set by the browser and can be spoofed by the user right? And didn't you just say not to check the mime type when uploading files?

Sorry for all the questions, just slightly confused Smile