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