def cloudinary_direct_upload(callback_url, **options): params = uploader.build_upload_params(callback=callback_url, **options) params = utils.sign_request(params, options) api_url = utils.cloudinary_api_url("upload", resource_type=options.get("resource_type", "image"), upload_prefix=options.get("upload_prefix")) return {"params": params, "url": api_url}
def cloudinary_direct_upload(callback_url, **options): params = uploader.build_upload_params(callback=callback_url, **options) params = utils.sign_request(params, options) api_url = utils.cloudinary_api_url( "upload", resource_type=options.get("resource_type", "image"), upload_prefix=options.get("upload_prefix")) return {"params": params, "url": api_url}
def cloudinary_direct_upload(callback_url, **options): params = uploader.build_upload_params(callback=callback_url, **options) params["signature"] = utils.api_sign_request(params, cloudinary.config().api_secret) params["api_key"] = cloudinary.config().api_key api_url = utils.cloudinary_api_url("upload", resource_type=options.get("resource_type", "image"), upload_prefix=options.get("upload_prefix")) for k, v in params.items(): if not v: del params[k] return {"params": params, "url": api_url}
def upload(self, image): res = uploader.call_api( "upload", uploader.build_upload_params(), api_key=self.api_key, api_secret=self.api_secret, cloud_name=self.name, file=image.stream, ) return res ''' res example: