Welcome Guest, Not a member yet? Register   Sign In
Can't updload csv file with upload->do_upload()
#8

(02-09-2015, 09:40 AM)mariek Wrote: Yep, strange, maybe CI has changed recently on this point. It works on my recent projects (CI 2.1).

@Narf : I know user input should not be trusted but it is the way CI does it. My point was only to check what mime type is detected by the script, to check if it's in CI config array.

It's not how CI does it - that was my point.

$_FILES[$file]['type'] is an absolutely last-resort assumption in CI's MIME type detection. If you're reaching it, it means that you have none of the following:

- ext/fileinfo (finfo_file()), which is bundled and installed with PHP by default since version 5.3)
- exec(), shell_exec(), popen() and /usr/bin/file under a UNIX-based OS (or you're using Windows)
- mime_content_type()

CodeIgniter will attempt to use all of the above (in the order they're listed) before it falls back to the browser-specified value that is in $_FILES, so virtually no application should be ever relying on that one.
Reply


Messages In This Thread
RE: Can't updload csv file with upload->do_upload() - by Narf - 02-09-2015, 10:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB