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

为上传添加 fieldName 选项 #562

Closed
limodou opened this issue Jul 10, 2020 · 1 comment
Closed

为上传添加 fieldName 选项 #562

limodou opened this issue Jul 10, 2020 · 1 comment
Assignees
Milestone

Comments

@limodou
Copy link

limodou commented Jul 10, 2020

你在什么场景下需要该功能?

因为后台用的字段名写死了不好修改,只能前端去适配。

描述可能的解决方案

将 formData.append("file[]", validateResult[i]); 这里的 file[] 改为从 options.upload.fieldName 获取,缺省值可以为 file[],并且不建议与 multiple 连取,即当为 true 时自动在后面添加 [],还是由用户来处理。

描述你认为的候选方案

如上。

其他信息

@Vanessa219 Vanessa219 changed the title 上传的字段名能否自定义,由用户设置将 file[] 可以改为其它的 为上传添加 fieldName 选项 Jul 10, 2020
@Vanessa219 Vanessa219 self-assigned this Jul 10, 2020
@Vanessa219 Vanessa219 added this to the 3.3 milestone Jul 10, 2020
Vanessa219 added a commit that referenced this issue Jul 10, 2020
@limodou
Copy link
Author

limodou commented Jul 10, 2020

Wonderfull !

@limodou limodou closed this as completed Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants