Cloudinary supports file type restriction on the server-side for uploaded images, and this can be specified in the API call you make, or in an upload preset. This is via the 'allowed_formats' parameter: https://cloudinary.com/documentation/image_upload_api_reference#optional_parameters
This example using our Python SDK will allow only PNG uploads:
uploader.upload("tests/logo.png", allowed_formats = ['png'])
This example will return an error when the file is uploaded because it doesn't match the 'jpg' format allowed:
uploader.upload("tests/logo.png", allowed_formats = ['jpg'])
You can instruct Cloudinary to convert rejected formats to another one, by setting the format parameter. In this example, we allow only 'jpg' files, and if the uploaded file is not a JPG, Cloudinary will first convert it to JPG before uploading:
uploader.upload("tests/logo.png", allowed_formats = ['jpg'], format= 'jpg')
You can also use our Upload Widget or jQuery library to validate or adjust format, size, and dimensions on the client-side.
For example, please see this guide using our JS SDK:
For Upload Widget, please read about pre-batch validation.