Refactor single-file uploads.