fine-uploader

Changing the "Upload failed" Message


I would like to change the "Upload failed" message to one returned from my server-side processing.

I can see the message I want in the onError callback but I'm not sure how to used that instead of the default message.

Thoughts, examples or further reading advice welcome (new here).


Solution

  • The implementation of what you're trying to do depends on whether you are using Fine Uploader Basic/Core or Regular/UI. This is because UI mode offers some extra goodies for displaying error messages and such.

    A few properties/options that may benefit you:

    Fine Uploader Basic/Core mode

    var uploader = new qq.FineUploaderBasic({
        /* ... */
        text: {
            defaultResponseError: "Oh noes! Upload fail."
        }
    });
    

    The documentation on 'text'


    Fine Uploader Regular/UI mode

    var uploader = new qq.FineUploader({
        /* ... */
        text: {
            defaultResponseError: "Oh noes! Upload fail."
        },
        failedUploadTextDisplay: {
            mode: 'custom',              // Display error responses from the server.
            responseProperty: 'errorMsg' // Default is 'error', change this to match the 
                                         // property that contains the error message from 
                                         // your server
        }
    });
    

    The documentation on failedUploadTextDisplay