bugzid:15577 - handle file uploads correctly

https://sailthru.fogbugz.com/default.asp?15577