You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
george-es
changed the title
Request请求:Failed to execute 'setRequestHeader' on 'XMLHttpRequest': String contains non ISO-8859-1 code point.问题解决
Request请求:Failed to execute 'setRequestHeader' on 'XMLHttpRequest': String contains non ISO-8859-1 code point.
Dec 3, 2020
问题:
问题定位:
上传文件名为中文时报错
类型错误:未能在“XMLHttpRequest”上执行“setRequestHeader”:字符串包含非ISO-8859-1代码点。
问题分析:
初步怀疑是中文名导致的,在前端页面发送request请求到后台时,请求头即 header 中放入了中文,所以就会出现编码格式问题。
代码速览:
文件上传功能,调用 ali-oss 的 put 方法上传文件,在 meta 中设置 filename
解决方案
要解决问题就要对中文字符进行编码,到后台里再进行解码接收处理。
The text was updated successfully, but these errors were encountered: