You can intercept link click from JavaScript:
<a href="..document path" class="confirmation">Download document</a>
...
<script type="text/javascript">
var elems = document.getElementsByClassName('confirmation');
var confirmIt = function (e) {
if (!confirm('Do you agree...?')) e.preventDefault();
};
for (var i = 0, l = elems.length; i < l; i++) {
elems[i].addEventListener('click', confirmIt, false);
}
</script>
If you want to check something with server you can use AJAX call...
Of course, this way in this form can be avoided by entering direct path to document to browser.
A more secure way wold be to involve use .htaccess to intercept http requests to the document file, and call php instead. PHP should check if user confirmed and if he did serve document and if he didn't throw some message.