Question

If you are logged in, this URL: https://download.ama-assn.org/resources/doc/usan/x-pub/usan-february-2014-newsletter.pdf returns html page:

<div id="dlblock">
    <a href="http://www.ama-assn.org">
        <img src="https://www.ama-assn.org/resources/images/header/ama-logo.png" border="0">
    </a><br><br>
    You are about to download<br>
    <strong>
         <a id="file-link" href="/resources/doc/usan/x-pub/usan-february-2014-newsletter.pdf" target="_blank">usan-february-2014-newsletter.pdf</a>
    </strong>
    If you are not automatically redirected, please 
    <a href="/resources/doc/usan/x-pub/usan-february-2014-newsletter.pdf" target="_blank">click here</a> 
    to begin your download.   <br><br>
    <small>Copyright 1995-2014 
        <a href="http://www.ama-assn.org">American Medical Association</a> All rights reserved.
    </small>

If you click on the link on this page (and the url is the the same page just opened in new window) you will get pdf.

I don't understand how can server decide when to serve html and when pdf - how is this implemented?

Était-ce utile?

La solution

The server may read the http referer request header, and if it matched the URL of the page, serve the PDF version instead.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top