provider-upload-cloudinary: Why am i getting this error while media library upload

divyam
divyam Member Posts: 3
edited December 2023 in Developer APIs

I am trying to upload webm file to my strapi project and i am getting the following error:


image

1660×496 71.8 KB


my plugins.js file is set to default configuration that is:


upload is happening via @strapi/provider-upload-cloudinary which is of version 4.10.1



How can i control the allowed media types.

Tagged:

Answers

  • Wissam
    Wissam Member, Cloudinary Staff Posts: 103

    Hi @divyam,

    Thank you for reaching out.

    Cloudinary does support the WebM format for videos. However, the error message you're seeing suggests that the WebM format is not allowed in your current configuration.

    You will need to add resource_type: "video" since the default is image.

    Could you try to add within the upload under the actionOptions ?

    Best Regards,

    Wissam

  • divyam
    divyam Member Posts: 3

    @Wissam tried this method and its still throwing same error. Tried resource_type as both "video" and "image" one by one like below but still it didn't worked.

    upload: {

    folder: 'strapi',

    resource_type: 'image', }

  • Wissam
    Wissam Member, Cloudinary Staff Posts: 103

    Hi @divyam ,

    Can you share the cloud_name so that I can check our logs for these types of requests?

    Regards,

    Wissam

  • divyam
    divyam Member Posts: 3

    cloud_name is "mailmodo"

  • DannyFromCloudinary
    DannyFromCloudinary Member, Cloudinary Staff Posts: 150

    Hey @divyam .

    Thanks for confirming that. I've checked our logs for your cloud, and I'm not seeing any upload attempts in the last 30 days that use the resource_type "video", failed or successful. It may be that Strapi is doing something it shouldn't and setting the resource_type incorrectly.

    Could you please try performing an upload using resource_type: video locally, and then again using Strapi, to see if this is indeed the case? If the file is failing when you try to upload it locally, it would be great to see exactly what the file is to try to determine the reason why it's failing. If you're able to provide the file to us via a WeTransfer, or uploading it to your account as a .zip, we'll be able to take a look.

    If you would prefer to send the file to us directly, rather than sharing a link in a public forum such as this, you're welcome to open a ticket and reference this request (#253814)

    It's worth noting that @strapi/provider-upload-cloudinary isn't a library we have written or maintain, so if there is an issue with it, you would need to contact Strapi directly via https://strapi.io/contact