cleaned up file uploading; fixes #21