Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议formData.append(option.filename, option.file)时,将第三个参数也加上。 #239

Open
Lin47 opened this issue Apr 17, 2020 · 1 comment

Comments

@Lin47
Copy link
Contributor

Lin47 commented Apr 17, 2020

在使用IE11等不支持File constructor的浏览器的情况时,使用transformFile进行图片压缩时,只能返回blob类型数据。
image
由于request.js中代码 formData.append(option.filename, option.file)并未设置第三个参数filename的值,导致blob文件命名都会变成blob。
可以将代码修改为 formData.append(option.filename, option.file, option.file?.name)
这样只需要在返回blob时自定义blob 的name属性即可达到File类型的效果,而不需要复制一份request来修改代码,并传入customRequest属性来自定义上传表现。

@afc163
Copy link
Member

afc163 commented Apr 17, 2020

pr welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants