in the download you are using the expedients column what is the value stored in that column?
it sounds like the value stored in that column is the file name excluding the extension.
the download counter is expecting to get the id from the id_exp querystring variable which is not present when the download form posts.
you need to modify the form action to pass the querystring variable:
<form action="pageName.php?id_exp=<?php echo(isset($_GET['id_exp'])?$_GET['id_exp']:""); ?>" method="post" id="formDescarga">
Thank you Jason,
The expedients column store the file name, but I tried with and without extension name and doesn´t work. [After changed the Form it works]
What type of field for the counter in the DB I need?