This support forum is no longer in use. Please use the Cloudinary Community at https://community.cloudinary.com/ to receive assistance from other members of the community and from Cloudinary's support team. For account-specific questions or if you believe that you've encountered a bug, please contact the Cloudinary team directly via the "submit a request" option on this support site.

Add additional values when uploading via jQuery

Comments

2 comments

  • Avatar
    Chris Hill

    Well it turns out the problem was very, very sneaky. This should also most likely fix your angular example as well. It looks like the object returned from the series of on() calls is not the same value as $(".cloudinary_fileupload"). I fixed the issue by doing:

    $scope.widget = $(".cloudinary_fileupload"); $scope.widget.unsigned_cloudinary_upload(cloudinary.config().upload_preset, {}, {
    ...etc...

    It took me way too long to figure this out because the object returned from the on() calls looks identical to the value returned from $(".cloudinary_fileupload"), even in the debugger.

    It was only until I did this:

      var thing1 = $(".cloudinary_fileupload");
      var thing2 = $scope.widget;
      var thingsAreSame = thing1 == thing2;
      //thingsAreSame is false
    

    That I saw it return false.

    0
    Comment actions Permalink
  • Avatar
    Chris Hill

    Follow-up: apparently I need to always grab the variable via $(".cloudinary_fileupload") instead of storing the value in $scope.widget. I'm not exactly sure, because I'm newish to JS and all this method chaining is new to me.

    0
    Comment actions Permalink

Post is closed for comments.