Hmmm, not sure why the file name is not available to the template page,
Here's a workaround for using the template though:
the code to upload the file is:
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1") ;
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadResult1", "upload1", "2", "[NewFileName]_[Increment]", "JPG:80", $WA_UploadResult1_Params);
}
?>
you can change that to store the file name in a session:
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1") ;
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadResult1", "upload1", "2", "[NewFileName]_[Increment]", "JPG:80", $WA_UploadResult1_Params);
$_SESSION['fileName'] = $WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"];
}
?>
then use the session in the link:
<?php if(!session_id()) session_start(); ?>
<a href="http://www.mydomian.com/path/to/file/<?php echo $_SESSION['fileName'] ; ?>"><?php echo $_SESSION['fileName'] ; ?></a>