dify icon indicating copy to clipboard operation
dify copied to clipboard

HTTP Request Node Not Retrieve File Extension from Content-Disposition Header

Open EcoleKeine opened this issue 1 month ago • 5 comments

Self Checks

  • [X] This is only for bug report, if you would like to ask a question, please head to Discussions.
  • [X] I have searched for existing issues search for existing issues, including closed ones.
  • [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • [X] Please do not modify this template :) and fill in all the required fields.

Dify version

0.15.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. "http-request" download docx file
  2. "doc extractor" node

✔️ Expected Behavior

HTTP Request Node download the .docx file

❌ Actual Behavior

"doc extractor" node error: Unsupported Extension Type: .bin

Http request output:

{
  "status_code": 200,
  "body": "",
  "headers": {
    "server": "openresty",
    "date": "Fri, 10 Jan 2025 08:24:28 GMT",
    "content-type": "application/octet-stream; charset=UTF-8",
    "content-length": "19121",
    "connection": "keep-alive",
    "accept-ranges": "bytes",
    "etag": "64ba7c8713b64b689feeb4cc2b1f4954",
    "content-disposition": "attachment; filename=\"%e4******%95.docx\"; charset=UTF-8"
  },
  "files": [
    {
      "dify_model_identity": "__dify__file__",
      "id": null,
      "tenant_id": "3e581dc4-d40f-412b-b1de-dcc39fa288b4",
      "type": "custom",
      "transfer_method": "tool_file",
      "remote_url": null,
      "related_id": "1c9dd6a3-d0e2-4fd6-b899-222fc34eb366",
      "filename": "32b96deebef6444bad37bab894fb5d37.bin",
      "extension": ".bin",
      "mime_type": "application/octet-stream; charset=UTF-8",
      "size": 19121,
      "url": "/files/tools/1c9dd6a3-d0e2-4fd6-b899-222fc34eb366.bin?timestamp=1736497468&nonce=d2a5bb1c5141ab6b91ae877a8550d894&sign=5b7SpNwVHSfBruJ8zJc8AuGMAqOiCZfMRgWf0EnHuRg="
    }
  ]
}

"doc extractor" data handle :

{
  "documents": [
    {
      "dify_model_identity": "__dify__file__",
      "id": null,
      "tenant_id": "3e581dc4-d40f-412b-b1de-dcc39fa288b4",
      "type": "custom",
      "transfer_method": "tool_file",
      "remote_url": null,
      "related_id": "1c9dd6a3-d0e2-4fd6-b899-222fc34eb366",
      "filename": "32b96deebef6444bad37bab894fb5d37.bin",
      "extension": ".bin",
      "mime_type": "application/octet-stream; charset=UTF-8",
      "size": 19121,
      "url": "/files/tools/1c9dd6a3-d0e2-4fd6-b899-222fc34eb366.bin?timestamp=1736497468&nonce=e4c5844225ee8e0b11424aaaad307e1c&sign=ZkMjOv1-A9YpkQ3iBSn2Yu8ANZO9AbMarklwQh9IasU="
    }
  ]
}

EcoleKeine avatar Jan 10 '25 08:01 EcoleKeine