Cloudinary Blog

Using Cloudinary to manage all your website’s assets in the Cloud

When we conceived Cloudinary, our vision was to help websites manage all their assets (images, Javascripts, CSS, etc.) in the cloud, easily and effectively. Our initial focus was on image management in the cloud since we've felt that this particular area was significantly underdeveloped. We figured that every web developer would be happy with a solid solution for image uploads, applying image transformations in the Cloud and getting their website's images delivered through a fast CDN.

We've recently taken the plunge and added support for raw file uploads and CDN delivery. In addition to images, you can now use Cloudinary's same simple APIs and dynamic URLs to manage every file in the cloud - CSS, Javascript, PDF, and more. The advantages:

  • Simple API for uploading files to a safe cloud storage.
  • Strong integration with your development environment and model objects.
  • Simple access to managed files through dynamic URLs.
  • Fast, optimized CDN delivery (correct cache settings, etc.)
Uploaded files are stored in the cloud and immediately made accessible. As opposed to uploaded images, raw files are kept as-is and not transformed in any way (though we have cool ideas for time-saving transformations we can offer for these files). 
 
Here's a quick example. Suppose you want to link to an Excel spreadsheet file from your website.
 
The following Ruby snippet will upload the XLS file to your Cloudinary account.
 
Cloudinary::Uploader.upload("sample_spreadsheet.xls", 
                                                   :public_id => "sample_spreadsheet",
                                                   :resource_type => :raw)
 
Behind the scenes, the uploading is done through our RESTful API. See our documentation for more details.
 
Downloading the uploaded file is done using a simple dynamic URL:


Cloudinary also supports a single API endpoint for all kinds of files, using the ‘auto’ resource type. This is useful if you allow your visitors to upload files of arbitrary format, image or otherwise, to your web app.
The result of the API upload request includes the final URL the uploaded file is available at. For image files, you can add any image transformation parameters as in standard image uploading.
 
The URL for uploading files with automatic type detection (replace ‘demo’ with your cloud name):
 
https://api.cloudinary.com/v1_1/demo/auto/upload

And in Ruby on Rails use the following:

Cloudinary::Uploader.upload(“sample_document.pdf”, :resource_type => :auto)

Like most of our features, raw file uploading is available now for all free & paid plans. 

 

Recent Blog Posts

Build VS. Buy
At Build.com, where I’m a software architect, we manage hundreds of millions of images. Our site offers more than 1 million home improvement products, such as tubs, toilets, cabinets, fireplaces – really any thing homeowners need for their improvement projects. And for each item, there are multiple images – product and gallery images, action shots, close-ups and thumbnails – that our visitors view from a variety of devices, including mobile phones, tablets, their desktop computers and our native app. In addition, these images are used in many view templates – on the landing page, via search, by category and in the cart.
Read more
Image Management Best Practices
 
There’s no debating the fact that including images on your website or mobile app draws the interest of users and leads to stronger engagement. For example, posts that include images produce 650 percent higher engagement than text-only posts, according to a WebDAM infographic. Use of attention-grabbing images is only going to grow. Consider that by 2018, 84 percent of communication will be visual, the infographic noted. 
Read more

File Upload With PHP

By Prosper Otemuyiwa
How to handle file uploads with PHP

There are lots of images and videos all over the internet. A lot of applications these days demand that the user is able to manipulate files and upload to the server. Thankfully, PHP provides the functions to handle file uploads.

Read more