modified upload_file and _post_multipart in order to support non-ascii encoding