Documentation on Direct Browser Upload Without jQuery?


1 comment

  • Avatar
    Loic Verger Del Bove

    Hi Brad,

    Based on, you can find an example of a signed upload using the Upload Widget here :

    To test it, you can add your credentials on the index.js starting Line 11 and your signed upload_preset to line 4 of the script.js.

    The sample project uses the 'string' method by adding all the parameters used to a string 'params_to_sign' :

    var params_to_sign = "source=" + source + "&timestamp=" + timeStamp + "&upload_preset=" + uploadPreset;

    and you can generate a sha1 signature by using the following piece of code :

    var sha1 = crypto.createHash("sha1");
    sha1.update(params_to_sign + cloudinary.config("api_secret"));
    var signature_sha = sha1.digest("hex");

    You can use also the api_sign_request of our SDK that will generate the signature automatically by passing the 'params_to_sign' not as a string but as an object :

    var params_to_sign = {
        source: source,
        timestamp: timeStamp,
        upload_preset: uploadPreset

    and you can generate the same signature like this :

    var signature_sha = cloudinary.utils.api_sign_request(params_to_sign,cloudinary.config("api_secret"));

    If you add any parameters to the upload widget, you will have to add this value in the 'params_to_sign' term.

    You can also get more informations on the following link:

    Best regards,

    NB: you may need to sign up to as the project use a container not supported by codesandbox template

    Comment actions Permalink

Please sign in to leave a comment.