weixin_33716941 2017-02-17 14:41 采纳率: 0%
浏览 31

Iron-ajax下载文件

I want to using download a file using Polymer's Iron-Ajax.

<iron-ajax
  id="fileDownloader"
  headers='{"Auth" :"token"}'
  url="/my/server/rest/download/csv/{{id}}"
  method="GET"
  content-type="application/json"
  on-response="downloadCsvCallLoaded"
  on-error="downloadCsvCallFailed">
</iron-ajax>

The reposnse actually contains the data, but it does not trigger the browser to download the file.

  • 写回答

3条回答 默认 最新

  • weixin_33735077 2017-02-17 15:16
    关注

    I think you need to use handle-as="blob"property in your element declaration. Here you can find more information about it.

    评论

报告相同问题?