Implemented file upload.

Changes throughout.