简体   繁体   中英

Uploading base64 hashed image to Cloudinary

Is there a way to upload an image as a base64 hash to Cloudinary? I cannot find a parameter for PHP uploader library.

Cloudinary's upload API call accepts the following options:

file - The resource to upload. Can be one of the following:
A local path (e.g., '/home/my_image.jpg').
An HTTP URL of a resource available on the Internet (e.g., 'http://www.example.com/image.jpg').
A URL of a file in a private S3 bucket white-listed for your account (e.g., 's3://my-bucket/my-path/my-file.jpg')

says here: http://cloudinary.com/documentation/php_image_upload

Cloudinary supports uploading files using a base64 encoded data of the image. You should make sure that you send your content as a Data-URI as explained here: http://en.wikipedia.org/wiki/Data_URI_scheme .

For example in PHP:

\Cloudinary\Uploader::upload("data:image/jpeg;base64...")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM