Is to possible to find filename from http headers

前端 未结 1 1131

Usually when downloading files, suppose using QNetworkAccessManager, the filename is not present at the end of link. How to get proper file names in that case. Even if link does

相关标签:
1条回答
  • 2021-01-21 22:36

    Yes. It's the Content-Disposition: attachment; filename=<file name.ext> header. There's a strong suggestion to set the content type to application/octet-stream so browsers and their plugins are not tempted to open it instead.

    0 讨论(0)
提交回复
热议问题