toolbelt
toolbelt copied to clipboard
When dname is Chinese, the server will return a 400 error
m = MultipartEncoder(
{'uploadFile': (dname, open(name, 'rb'), 'application/pdf')})
当 dname 是中文的时候,服务器会返回400错误。 When dname is Chinese, the server will return a 400 error. Is it because of encoding? thanks
Content-Disposition: form-data; name="upload_file"; filename*=utf-8''%E5%95%8A%E5%AE%9E%E6%89%93%E5%AE%9E.rar Content-Type: application/octet-stream
Content-Disposition: form-data; name="upload_file"; filename="啊实打实.rar" Content-Type: application/octet-stream
文件名被编码了所以不能被服务器识别 ,应该为filename="啊实打实.rar"而不是 filename*=utf-8''%E5%95%8A%E5%AE%9E%E6%89%93%E5%AE%9E.rar 现在问题知道了,搞了几天了就是不怎么怎么解决。