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