adnan kamili
adnan kamili

Reputation: 9455

Is to possible to find filename from http headers

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 doesn't contain a hint of name, firefox always downloads the file with its proper name and extension. We can get a hint of extention using mime-types but what about file names.

Upvotes: 2

Views: 1072

Answers (1)

MSalters
MSalters

Reputation: 179819

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.

Upvotes: 3

Related Questions