Popup Error Messages

This topic contains 4 reply and 2 voices, and was last updated by kiwi 10 years, 9 months ago
Viewing 4 Posts - 1 through 4 (of 4 total)
Author Posts
January 11, 2014 at 8:43 pm 14314
kiwi Is there any way to customise the messages that appear when users upload the incorrect file size or file type? Just looking to add something more user friendly. Eg. Error #-601: File extension error would become something like... You have uploaded an incorrect file type. Please try again. or... The file you have uploaded exceeds the file size limit. Please try again.
January 12, 2014 at 11:49 am 14323
Tareq Hasan Tareq Hasan

Yes, that can be done. On /js/upload.js, change the error function this way:

[js]
error: function (up, error) {
$(‘#’ + this.container).find(‘#’ + error.file.id).remove();

var msg = ”;
switch(error.code) {
case -600:
msg = ‘The file you have uploaded exceeds the file size limit. Please try again.’;
break;

case -601:
msg = ‘You have uploaded an incorrect file type. Please try again.’;
break;

default:
msg = ‘Error #’ + error.code + ‘: ‘ + error.message;
break;
}

alert(msg);

this.count -= 1;
this.showHide();
this.uploader.refresh();
},
[/js]

January 12, 2014 at 1:14 pm 14326
kiwi kiwi This reply has been marked as private.
January 12, 2014 at 1:55 pm 14327
Tareq Hasan Tareq Hasan

May be you should clear your browser cache.

January 12, 2014 at 3:34 pm 14328
kiwi kiwi

Ok working perfectly now. Thanks Tareq.

Viewing 4 Posts - 1 through 4 (of 4 total)