Index: qanda.php
===================================================================
--- qanda.php	(revision 10017)
+++ qanda.php	(working copy)
@@ -3849,6 +3849,18 @@
                     });
                 </script>';
 
+	$answer .= '<script type="text/javascript">
+                    $(document).ready(function(){
+ 						var fieldname = "'.$ia[1].'";
+			 			var filecount = $("#"+fieldname+"_filecount").val();
+ 						var json = $("#"+fieldname).val();
+						var show_title = "'.$qidattributes["show_title"].'";
+						var show_comment = "'.$qidattributes["show_comment"].'";
+						var pos = "'.($pos?1:0).'";
+						displayUploadedFiles(json, filecount, fieldname, show_title, show_comment, pos);
+    				});
+  	          </script>';
+
     $inputnames[] = $ia[1];
     $inputnames[] = $ia[1]."_filecount";
     return array($answer, $inputnames);
Index: scripts/modaldialog.js
===================================================================
--- scripts/modaldialog.js	(revision 10017)
+++ scripts/modaldialog.js	(working copy)
@@ -121,7 +121,13 @@
     var jsonobj;
     var i;
 
-    if (jsonstring !== '')
+    if (jsonstring == '[]') {
+    	var display ='';
+    	$('#'+fieldname+'_uploadedfiles').html(display);
+		return;
+    }
+
+	if (jsonstring !== '')
     {
         jsonobj = eval('(' + jsonstring + ')');
         var display = '<table width="100%"><tr><th align="center" width="20%">&nbsp;</th>';