Skip to content

下载后保存的中文文件文件名乱码 #11847

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

Open
zbl400 opened this issue Apr 11, 2025 · 0 comments
Open

下载后保存的中文文件文件名乱码 #11847

zbl400 opened this issue Apr 11, 2025 · 0 comments

Comments

@zbl400
Copy link

zbl400 commented Apr 11, 2025

描述问题:

使用下载功能, 后台文件名是中文的,已经使用了,但是保存的文件仍然是乱码。
后台返回的content-disposition,已经是编码过的文件名了。

attachment; filename="页�-device.sql"; filename*=UTF-8''%E9%A1%B5%E9%9D%A2-device.sql

截图或视频:

Image

Image

如何复现(请务必完整填写下面内容):

  1. 你是如何使用 amis 的?
    使用 npm ,react

  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
    amis 6.11.0 及 amis 6.12.0 都有这个问题

  3. 粘贴有问题的完整 amis schema 代码:

{
  "type": "button",
  "id": "u:c2c9b990f462",
  "label": "导出",
  "level": "link",
  "onEvent": {
    "click": {
      "actions": [
        {
          "api": {
            "url": "/_sys/pages/${key}/sql",
            "method": "get",
            "sendOn": "${key}",
            "silent": false,
            "adaptor": "",
            "messages": {},
            "responseType": "blob",
            "requestAdaptor": ""
          },
          "actionType": "download",
          "ignoreError": false
        }
      ]
    }
  },
  "disabledOnAction": false
}
  1. 操作步骤
    生成一个下载按钮,点击,能够下载文件,但是文件名乱码
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

1 participant