From 43c7b8c642a5fc8541122414849a75770975b222 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 30 Oct 2010 17:26:32 +0000 Subject: handling errors in ajax upload --- views/default/tidypics/forms/ajax_upload.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'views/default/tidypics/forms') diff --git a/views/default/tidypics/forms/ajax_upload.php b/views/default/tidypics/forms/ajax_upload.php index 87a6ad0ed..47aa954c7 100644 --- a/views/default/tidypics/forms/ajax_upload.php +++ b/views/default/tidypics/forms/ajax_upload.php @@ -83,8 +83,6 @@ $("#uploadify").uploadify({ 'cancelImg' : '_graphics/icon_customise_remove.gif', 'multi' : true, 'auto' : false, - 'fileDesc' : '', - 'fileExt' : '*.jpg;*.jpeg;*.png;*.gif', 'wmode' : 'transparent', 'buttonImg' : " ", 'height' : 20, @@ -117,8 +115,12 @@ $("#uploadify").uploadify({ } ); }, - 'onComplete' : function(event, queueID) { + 'onComplete' : function(event, queueID, fileObj, response) { // check for errors here + if (response != 'success') { + $("#uploadify" + queueID + " .percentage").text(" - " + response); + $("#uploadify" + queueID).addClass('uploadifyError'); + } $("#uploadify" + queueID + " > .cancel").remove(); return false; }, -- cgit v1.2.3