header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
$byteswritten = readfile($file);
<?php if ((!empty($this->item->jcfields[11]->value)) && (!empty($this->item->jcfields[12]->value))) : ?>
<div class="lien"><a href="/<?php echo $this->item->jcfields[11]->value; ?>" title="download file"><?php echo $this->item->jcfields[12]->value; ?></a> </div>
<?php endif ; ?>
$value = (string) $field->value;
code changes works.
An improvement that would be useful:
you should have a third choice in the field "Display formatted value?" which will give the link of the value.
I just realised that saving download field values when editing articles doesn't work in Joomla 3.8.10 without a different code change
if (isset($field["rawcustomfieldoutput"]) && $field["rawcustomfieldoutput"] == 1 && isset($this->fieldreference->rawvalue))
if (isset($field["customfieldoutputraw"]) && $field["customfieldoutputraw"] == 1 && isset($this->fieldreference->rawvalue))