def create_upload(self, filepath): return MultipartEncoder({ 'file': (os.path.basename(filepath), open(filepath, 'rb'), self.file_type) })