Fixing file upload issue. Part of #971