cloudinex v0.6.0 Cloudinex.Uploader View Source
Cloudinary is a cloud-based service that provides an end-to-end image management solution, including upload, storage, administration, manipulation, optimization and delivery.
With Cloudinary you can easily upload images to the cloud and automatically perform smart image manipulations without installing any complex software. Cloudinary provides a secure and comprehensive API for easily uploading images from server-side code, directly from the browser or from a mobile application. You can either use Cloudinary’s API directly or through one of Cloudinary’s client libraries (SDKs), which wrap the upload API and simplify integration with web sites and mobile applications.
The uploaded images can then be automatically converted to all relevant formats suitable for web viewing, optimized for web browsers and mobile devices, normalized, manipulated in real time, and delivered through a fast CDN to users (see the image transformations documentation for more information).
Link to this section Summary
Functions
Uploads file
Creates a new image with the text binary provided
Uploads provided URL of an image on the internet
Link to this section Types
option() :: {:method, Tesla.Env.method()} | {:url, Tesla.Env.url()} | {:query, Tesla.Env.query()} | {:headers, Tesla.Env.headers()} | {:body, Tesla.Env.body()} | {:opts, Tesla.Env.opts()}
Link to this section Functions
Uploads file
iex> Cloudinex.Uploader.upload_url("./example.jpg")
{:ok,
%{"bytes" => 228821,
"created_at" => "2017-09-03T20:43:45Z",
"etag" => "96703c568b938567551bf0e408ab2f2a",
"format" => "jpg",
"height" => 2048,
"original_filename" => "02qqN5T",
"public_id" => "i5duxjofpqcdprjl0gag",
"resource_type" => "image",
"secure_url" => "https://res.cloudinary.com/demo/image/upload/v1504471425/i5duxjofpqcdprjl0gag.jpg",
"signature" => "5f0475dfb785049d97f937071802ee88cc153ed0",
"tags" => [],
"type" => "upload",
"url" => "http://res.cloudinary.com/demo/image/upload/v1504471425/i5duxjofpqcdprjl0gag.jpg",
"version" => 1504471425,
"width" => 2048}}
Creates a new image with the text binary provided
iex> Cloudinex.Uploader.upload_text("Your Text")
{:ok, %{
"bytes" => 539,
"created_at" => "2017-09-03T20:38:00Z",
"format" => "png",
"height" => 10,
"public_id" => "FAKE",
"resource_type" => "image",
"secure_url" => "https://res.cloudinary.com/pdemo/image/text/image.png",
"signature" => "ce43e5d06a3be722c926405f2a3905283e879357",
"tags" => [],
"type" => "text",
"url" => "http://res.cloudinary.com/pdemo/image/text/image.png",
"version" => 1504471080,
"width" => 33}}}
Uploads provided URL of an image on the internet
iex> Cloudinex.Uploader.upload_url("http://example.com/example.jpg")
{:ok,
%{"bytes" => 228821,
"created_at" => "2017-09-03T20:43:45Z",
"etag" => "96703c568b938567551bf0e408ab2f2a",
"format" => "jpg",
"height" => 2048,
"original_filename" => "02qqN5T",
"public_id" => "i5duxjofpqcdprjl0gag",
"resource_type" => "image",
"secure_url" => "https://res.cloudinary.com/demo/image/upload/v1504471425/i5duxjofpqcdprjl0gag.jpg",
"signature" => "5f0475dfb785049d97f937071802ee88cc153ed0",
"tags" => [],
"type" => "upload",
"url" => "http://res.cloudinary.com/demo/image/upload/v1504471425/i5duxjofpqcdprjl0gag.jpg",
"version" => 1504471425,
"width" => 2048}}