Skip to content Skip to sidebar Skip to footer

Correct Way For Uploading Image Bytes To Cloudinary

I am using http://cloudinary.com/documentation/image_upload_api_reference as reference. There are two cases in which I want to upload the files to cloudinary. Upload image by dire

Solution 1:

Your img_src parameter, which represents file, should be populated with either a byte array buffer (bytearray) or a Base64 URI. You can try something like:

    with open(img_src_str, "rb") as imageFile:
      f = imageFile.read()
      img_src = bytearray(f)

    cloudinary_response = cloudinary.uploader.upload(
      img_src,
      ...
    )

Post a Comment for "Correct Way For Uploading Image Bytes To Cloudinary"