Home Forums Plugin Support WP User Frontend (Free Version) Popup Error Messages

This topic is: resolved

This topic contains 4 replies, has 2 voices, and was last updated by  kiwi 5 years, 5 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #14314

    kiwi
    Participant
    Post count: 99

    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.

    #14323

    Tareq Hasan
    Keymaster
    Post count: 2831

    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]

    #14326

    kiwi
    Participant
    Post count: 99
    This reply has been marked as private.
    #14327

    Tareq Hasan
    Keymaster
    Post count: 2831

    May be you should clear your browser cache.

    #14328

    kiwi
    Participant
    Post count: 99

    Ok working perfectly now. Thanks Tareq.

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Popup Error Messages’ is closed to new replies.