Skip to main content




  • Tal Lev-Ami

    This usually means the fileupload field has not been properly initialized, specifically, the parameters that go into formData have not been properly set.

    Are you trying to set the data-form-data in javascript? If so, see

    For general documentation about direct uploads from the browser using PHP see

  • Barry Burrows

    Hi, No I am not trying to set the data-form-data via javascript I have it being passed in from the server side.  Looking at the post you recommended I have swapped the json string to the parameter hash.

    $.cloudinary.config({"api_key":"","cloud_name": ""});

    $(document).ready(function() {

    //$(".cloudinary-fileupload").attr("data-form-data", "api_key=<key>&callback=<url>/cloudinary_cors.html&public_id=2c68ebf2f34d1b09&signature=c37ab1b130c43326179a8c58eb339f0bda95b4e8&timestamp=1375449516");



    start: function (e) {

    $('.status_value').text('Starting direct upload...');


    progress: function () {



    done: function (e, data) {

    $.each(data.result.files, function (index, file) {




    progressall: function (e, data) {

    var progress = parseInt(data.loaded / * 100, 10);

    $('.progress_bar').css('width',progress + '%');


    fail: function (e, data) {



    // $(".preview").append("<p>" + val + "</p>");







    As a result I then get an Unauthorized response. 

    I have added the configuration settings outside of the document.ready after reading another post about that being an issue. 


  • Tal Lev-Ami

    The parameter formData needs to be a hash and not query-string serialized.

    If you are generating it from PHP, it's the result of:

            $params = Cloudinary\Uploader::build_upload_params($options);

            $params = Cloudinary::sign_request($params, $options);

    encoded as a Javascript hash.

    Another option is to use cl_image_upload_tag and let it create the entire input tag.


Post is closed for comments.