I think that in the attempt to get this to work, you have duplicated the server behavior a number of times, hence the multiple instances of code.
As an example, on one of my pages, i set the default file to a field in my update form called success_imageURL
On my page the code is as follows...
'DefaultFileName' => "".((isset($_POST["success_imageURL"]))?$_POST["success_imageURL"]:"") ."",
Hope this helps