1) In the download behavior, it is still set to use the ArquivoID column from the recordset for the key column value
2) the hidden form elment you added is set to use the value from the first hidden field:
<input name="hiddenField2" type="hidden" id="hiddenField2" value="<?php echo((isset($_POST["hiddenField"]))?$_POST["hiddenField"]:"") ?>" />
it should be set to use the ArquivoID column from the recordset.
the idea is to bind the hidden field to the ID column from the recordset,
and in the Download server behavior bind the key column value to the hidden field.
NOTE: instead of pasting the code for the page, please compress the page to a zip archive and attach the zip file to your response.