Server side: detecting if a user is downloading (save as...) or visualizing a file in the browser

StackOverflow https://stackoverflow.com/questions/22996788

I'm writing an apache2 module

  • by default and when viewed in a web browser, the module would only print the first lines of a large file and convert them to HTML.

  • if the user choose to 'download as...', the whole raw file would be downloaded.

Is it possible to detect this choice on the server side ? (for example is there a specific http header set ?).

note: I would like to avoid any parameter in the GET url (e.g: "http://example.org/file?mode=raw" )

Pierre

有帮助吗?

解决方案

added my own answer to close the question: as said @alexeyten there is no difference. I ended by a javascript code the alter the index.html file generated by apache.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top