clientAllowedFormats is not restricting from sources such as google drive, facebook
Hi,
I'm implementing in the cloudinary widget the `clientAllowedFormats` parameter to restrict the user to upload images, I'd like to let the user upload media with only the format gif, mp4 and mov. For this, I'm adding in the widget creation the clientAllowedFormats parameter like this:
cloudinary.createUploadWidget(
{
cloud_name: 'example',
upload_preset: 'my-preset',
folder:`/my-folder`,
theme:'minimal',
defaultSource:'local',
sources: ['local', 'url', 'google_drive', 'facebook', 'instagram'],
show_powered_by:false,
autoMinimize:false,
clientAllowedFormats: ['gif', 'mp4', 'mov'],
} .......
This is working fine from the local source but, from other sources such as google drive or facebook, it is letting me upload png/jpg images.
If I add the `resourceType` parameter like this: `resourceType: 'video'` it only let me upload videos (as expected) but, it's not letting me upload gifs as I added in the clientAllowedFormats parameter.
What am I doing wrong here?
Thanks in advance for any help.
This is working fine from the local source but, from other sources such as google drive or facebook, it is letting me upload png/jpg images.
If I add the `resourceType` parameter like this: `resourceType: 'video'` it only let me upload videos (as expected) but, it's not letting me upload gifs as I added in the clientAllowedFormats parameter.
What am I doing wrong here?
Thanks in advance for any help.
0
-
Hi Leaf,
Indeed, this behavior is by design.
The clientAllowedFormats clientAllowedFormats
We could not identify the file (mime) type that is being uploaded from other sources, so we cannot apply these restrictions on the client-side for URL-based uploads.
thanks,
Wissam
0 -
thanks for your reply Wissam!
0
Post is closed for comments.
Comments
2 comments