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

文件上传组件有bug #11600

Open
BrentHuang opened this issue Feb 13, 2025 · 2 comments
Open

文件上传组件有bug #11600

BrentHuang opened this issue Feb 13, 2025 · 2 comments
Labels
bug Something isn't working need confirm

Comments

@BrentHuang
Copy link

BrentHuang commented Feb 13, 2025

前后端分离,amis版本6.10.0,文件上传组件有bug,当选择一个文件时,字段名叫files,没问题;当选择多个文件时,字段名仍旧应该叫files,而不是files[]。bug如下图:

Image

组件配置:“随表单提交”->“二进制”

 {
    "name": "files",
    "label": "打印文件",
    "type": "input-file",
    "id": "u:2f02280d2fae",
    "btnLabel": "文件上传",
    "uploadType": "asForm",
    "proxy": false,
    "autoUpload": true,
    "useChunk": false,
    "accept": "",
    "drag": false,
    "asBlob": true,
    "formType": "asBlob",
    "required": true,
    "multiple": true
}

可以用裸的html form表单做对比:

  <form action="http://localhost:8000/api/v1/slices/upload/" enctype="multipart/form-data" method="post">
    <label for="file-upload">选择文件:</label>
    <input type="file" id="file-upload" name="files" multiple>
    <br><br>
    <input type="submit" value="上传">
  </form>

上面的html代码,提交的数据截图如下:

Image

Copy link

👍 Thanks for this!
🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

@github-actions github-actions bot added the bug Something isn't working label Feb 13, 2025
@BrentHuang
Copy link
Author

@2betop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need confirm
Projects
None yet
Development

No branches or pull requests

1 participant