1

有没有办法将图像作为 base64 哈希上传到 Cloudinary?我找不到 PHP 上传器库的参数。

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')

在这里说:http: //cloudinary.com/documentation/php_image_upload

4

1 回答 1

2

Cloudinary 支持使用图像的 base64 编码数据上传文件。您应该确保将内容作为 Data-URI 发送,如下所述:http ://en.wikipedia.org/wiki/Data_URI_scheme 。

例如在 PHP 中:

\Cloudinary\Uploader::upload("data:image/jpeg;base64...")
于 2014-06-05T11:54:20.543 回答