Page 1 of 1

PHP Upload File Verification

Posted: Thu Sep 18, 2008 10:20 am
by rbc
I've been going round and round with a php upload application I'm working on. I have setup a MIME TYPE check to allow for certain file types to be permitted to be uploaded. However, I'm running into serious issues with .WMV files and have read that this might not be the best way to check files prior to uploading them as there are ways to hack around this type of check. If this is true is there a better way to check file types in this situation? What are they and can you give me some guidance or direction for this?

Thanks
Brian

Re: PHP Upload File Verification

Posted: Thu Sep 18, 2008 10:27 am
by Jade
You could always check the extension on the file using javascript. Otherwise there's no way to check the file information before you've sent some kind of request to the server since PHP is a server side programming language.

Re: PHP Upload File Verification

Posted: Thu Sep 18, 2008 10:59 am
by rbc
Couldn't they still hack around this the same as the could with a PHP MIME TYPE check?

Re: PHP Upload File Verification

Posted: Thu Sep 18, 2008 11:07 am
by Jade
When all is said and done it's not terribly difficult to do that with any kind of file. I'm not sure there is a fool-proof way to do it, but then again file systems aren't my specialty -- games are. Maybe someone else knows.