Heroku add-on

Uploadcare is an add-on that handles uploading, storing and processing files.

Uploadcare is a service that helps media creators, businesses and developers receive, store, process and deliver visual content to their clients.

Uploadcare is accessible via an API and has supported API clients for iOS, Python, Ruby, PHP, Node.js, Java, Erlang. Also there are plugins for Wordpress, CKEditor and tinymce.

Provisioning the add-on

Uploadcare can be attached to a Heroku application via the CLI:

callout A list of all plans available can be found here.

heroku addons:add uploadcare
-----> Adding uploadcare to sharp-mountain-4005... done, v18 (free)

Once Uploadcare has been added two API keys will be available in the app configuration:


This can be confirmed using the heroku config:get command.

heroku config:get UPLOADCARE_PUBLIC_KEY
heroku config:get UPLOADCARE_SECRET_KEY

After installing Uploadcare the application should be configured to fully integrate with the add-on.

Local setup

Environment setup

After provisioning the add-on it’s necessary to locally replicate the config vars so your development environment can operate against the service.

callout Though less portable it’s also possible to set local environment variables using export UPLOADCARE_PUBLIC_KEY=value; export UPLOADCARE_SECRET_KEY=value.

Use Foreman to configure, run and manage process types specified in your app’s Procfile. Foreman reads configuration variables from an .env file. Use the following command to add the UPLOADCARE_PUBLIC_KEY and UPLOADCARE_SECRET_KEY values retrieved from heroku config to .env.

heroku config -s | grep UPLOADCARE >> .env
more .env

warning Credentials and other sensitive configuration values should not be committed to source-control. In Git exclude the .env file with: echo .env >> .gitignore.

Using with Rails 4.x


Ruby on Rails applications will need to add the following entry into their Gemfile specifying the Uploadcare client library.

gem 'uploadcare-rails', "~> 1.0"

Update application dependencies with bundler.

bundle install


Uploadcare requires to store all related config in one single yml file. You should create uploadcare.yml in your config folder. Just run

bundle exec rails g uploadcare_config

then change your API KEYS

# config/uploadcare.yml
defaults: &defaults

Only two config settings are required: public and secret keys. All other posible options are listed here. Config file created by generator also contains a list of all options with default values. Note that global settings are used for internal API calls and as default config for file uploader. Any instanse of file uploader can have separate set of config that will override app-wide settings if needed.

Include javascript library in your layout

<%= include_uploadcare_widget_from_cdn %>
<%= uploadcare_settings %>

Use uploadcare fields


<%= uploadcare_uploader_field :post, :file %>
  results in:
  <input id="post_file" name="post[file]" role="uploadcare-uploader" type="hidden">
  <div class="uploadcare-widget" style="display: none;" data-status="ready">

Form tags

<%= form_for(@post) do |f| %>
  <div class="field">
    <%= f.label :title %><br/>
    <%= f.text_field :title %>
  <div class="field">
    <%= f.label :file %><br/>
    <%= f.uploadcare_field :file %>
  <div class="field">
    <%= f.label :file %><br/>
    <%= f.uploadcare_field :file %>
  <div class="field">
    <%= f.label :image_group %><br/>
    <%= f.uploadcare_multiple_uploader_field :image_group %>
  <div class="actions">
    <%= f.submit %>
<% end %>

Read more at uploadcare-rails docs

Using with Python/Django

Step 1. Install the pyuploadcare library

pip install pyuploadcare

Step 2. Add authentication settings to your settings.py file

import os

    'pub_key': os.environ.get('UPLOADCARE_PUBLIC_KEY'),
    'secret': os.environ.get('UPLOADCARE_SECRET_KEY'),

Step 3. Use pyuploadcare.dj.FileField in any model

No arguments needed!

from django.db import models

from pyuploadcare.dj import FileField

class Photo(models.Model):
    title = models.CharField(max_length=255)
    photo = FileField()

Read more in the pyuploadcare docs


callout For more information on the features available within the Uploadcare dashboard please see the docs at Uploadcare site.

The Uploadcare dashboard allows you to manage your projects, files, file uploader config.

The dashboard can be accessed via the CLI:

heroku addons:open uploadcare
Opening uploadcare for sharp-mountain-4005...

or by visiting the Heroku apps web interface and selecting the application in question. Select Uploadcare from the Add-ons menu.

Removing the add-on

Uploadcare can be removed via the CLI.

warning This will mark your project and all associated data as deprovisioned. Contact us at help@uploadcare.com, to retreive it.

heroku addons:remove uploadcare
-----> Removing uploadcare from sharp-mountain-4005... done, v20 (free)


Any non-support related issues or product feedback is welcome at help@uploadcare.com.