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.

uploadSignature error handling

Comments

2 comments

  • Avatar
    Raya Straus

    Hi Alex,

    If you're using our new upload widget (v2) then the implementation will be similar to the following-

    cloudinary.openUploadWidget({
      uploadPreset: "docs_preset",
      showCompletedButton: true,
      }, (error, result) => {
        const eventData = result.data;
        if (eventData.event === "success") {
          console.log("upload success ==> ",result); 
          });
    });
    

    For more information on our v2 upload widget and event handling please see the following- https://cloudinary.com/documentation/upload_widget_2#api_events

     

    -1
    Comment actions Permalink
  • Avatar
    Alex Bjørlig

    HI @Raya.

     

    Thanks for your answer, but I think you might have misread the question or maybe it was not precise enough. I was asking about the uploadSignature function.

     

    Tak for example the official example: 

      <script type="text/javascript">
        var generateSignature = function(callback, params_to_sign){
          $.ajax({
           url     : https://www.my-domain.com/my_generate_signature",
           type    : "GET",
           dataType: "text",
           data    : { data: params_to_sign},
           complete: function() {console.log("complete")},
           success : function(signature, textStatus, xhr) { callback(signature); },
           error   : function(xhr, status, error) { console.log(xhr, status, error); }
          });
        }
      </script>

    Here there is no error handling implementation, other than logging. Should the error not be passed back as the callback?

    I experimented with that in my implementation, but the upload widget then throws a weird error about unsigned upload?

    0
    Comment actions Permalink

Post is closed for comments.