Fixed a few issues in the file.js module that prevented it from working with file uploads.