Search code examples
apachehttpdownloadapache-modules

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


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


Solution

  • 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.