HTTP response header content disposition for attachments

后端 未结 5 1234
醉酒成梦
醉酒成梦 2020-12-24 14:36

Background

Write an XML document to a browser\'s response stream and cause the browser to display a \"Save As\" dialog.

Problem

Consider the foll

5条回答
  •  遥遥无期
    2020-12-24 15:13

    This has nothing to do with the MIME type, but the Content-Disposition header, which should be something like:

    Content-Disposition: attachment; filename=genome.jpeg;
    

    Make sure it is actually correctly passed to the client (not filtered by the server, proxy or something). Also you could try to change the order of writing headers and set them before getting output stream.

提交回复
热议问题