- 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.
: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):
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.