Revert "Improve file upload"

This reverts commit b663531c581567ae703f5da273c063d8de5aa5b8.