Singed widget uploads

Comments

5 comments

  • Avatar
    Raz Ziv

    Hey Vukica,

    Which version of our PHP SDK are you currently using? Is it v1 or the recently released v2 library?

    Thanks,
    Raz

    0
    Comment actions Permalink
  • Avatar
    Vukica

    Hi Raz,

    I'm using v2. I should also mention that I'm trying to use the "function" upload signature type, as I don't want the timestamp to expire.

    Thanks

    0
    Comment actions Permalink
  • Avatar
    Erwin Lukas

    Hi Vukica,

    Is there a reason you don't want to expire? If signature doesn't expire, then it would defeat the purpose of having a signed upload and unsigned upload should suffice for this scenario.

    However to answer to your question, `api_sign_request` is PHPv1 method, while PHPv2, you may want to use `signParameters`.
    Please check the following documentation for more info.

    Thanks,
    Erwin Lukas

    0
    Comment actions Permalink
  • Avatar
    Vukica

    Hi Erwin,

    As per your documentation page: https://cloudinary.com/documentation/upload_widget#signed_uploads , upload signature type for signed uploads can be either string or function. With string type, the signature is generated on page load, meaning that it will expire if the page is open for long (if I understood correctly). With the function type, the signature is generated once the visitor uploads an image, so there is no danger of the signature expiring and the user having to refresh the page.

    Thanks for the "signParameters" hint. I finally managed to get everything to work. 

    The docs that led me to the deprecated "api_sign_request" method stated that they refer the PHP SDK v2: https://cloudinary.com/documentation/php_integration . I highly recommend you guys correct these mistakes in order to save your customers' time. Adding the upload widget took me a week to figure out.

     

    0
    Comment actions Permalink
  • Avatar
    Aleksandar Kostadinov

    Hi Vukica,

    Thanks for the update, great to hear it's now working for you. And also for the feedback, our documentation team will certainly be updating the relevant parts of the docs in-line with the release of the 2.0 SDKs.

    0
    Comment actions Permalink

Please sign in to leave a comment.