This repository has been archived by the owner. It is now read-only.
Collect media from users with just a line of code.
JavaScript CoffeeScript Other
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Chute's Media Chooser component allows you to easily collect media from your users. Your user can directly upload photos from their hard drive or choose from an existing album on Facebook, Flickr, Picasa, or Instagram.

Getting Started

Go to Media Chooser's homepage and sign up using a simple one-field form.

Include media-chooser.min.js into your page (requires jQuery):

<script src=""></script>

Set your App ID:


To launch the Media Chooser:

  album: 123456  // album ID (optional; if not provided, assets will be stored to a newly created album)
}, function(urls, data) {
  alert(urls); // urls is an array of URL
  alert(data); // data is an array of metadata about the media item

Resizing Media

Chute gives you the ability to resize images easily. We offer several convenience methods:

var url = '' // sample url returned from the Media Chooser

// Fill a 500x300 rectangle
Chute.fill(500, 300, url); // =>

// Fit into 500x300 rectangle, 300, url); // =>

// Max width of 500px
Chute.width(500, url); // =>

// Max height of 300px
Chute.height(300, url); // =>


Setting defaults

You can set default properties for the Media Chooser using the setDefaults method:

  mediaTypes: 'all'

Limit total files

  limit: 5 // allow 5 files maximum
}, function(urls, data){

Limit by file types

  mediaTypes: 'images' // all | images (video coming soon!)
}, function(urls, data){

Restrict by image dimensions

  constraints: {
    width: '> 200 && < 500' // images with width bigger than 200 and less than 500 are allowed
}, function(urls, data){

Customize style

You can customize the Media Chooser's appearance by passing in your own CSS (see below for reference):

  css: ''
}, function(urls, data){

Allow only specified services

  services: ['upload', 'facebook'] // specify array of services
}, function(urls, data){

Embed chooser in an element

  embed: '#place-for-chooser' // selector for a target element
}, function(urls, data){



Here is the full list of parameters you can pass to Chute.MediaChooser.choose method:

Key Description
album ID of an album in Chute (see API docs)
app application identifier, can be set with choose call or globally with Chute.setApp()
constraints collection of restrictions for assets
css path to CSS file, which will be loaded in a widget
embed selector for an element, which will contain chooser
limit limits the number of total files
mediaTypes specifies type for selected files
popup boolean, which enables to open widget in a separate window
scripts comma-delimited paths to JS files, which will be loaded in a widget
services array of allowed services. upload, facebook, instagram, flickr or picasa can be specified
version version of the file picker, can be 1 or 2

Asset Data

After the Media Chooser closes, it returns both an array of urls and the data for those urls. Each Asset Object contains the following data:

  "moderated": false,
  "time": 1343204804.7934966,
  "assets": [{ // Array of data on selected assets
    "id": 14006623,
    "shortcut": "WLLhdwzi",
    "status": "complete",
    "url": "",
    "thumb_url": "",
    "is_portrait": true,
    "name": null, // Caption (if provided)
    "created_at": "2012-07-25T08:07:14Z",
    "updated_at": "2012-07-25T08:07:14Z",
    "height": 604,
    "width": 397,
    "md5": null,
    "is_published": true,
    "type": "image",
    "source": "0", // 0 indicates upload
    "source_id": "3084192643214", // id of the asset on original service
    "source_url": "",
    "service": null, // contains service imported from
    "import_id": null,
    "import_url": null,
    "original_url": "",
    "user": {
      "id": 402971,
      "name": "vdemedes",
      "username": "vdemedes",
      "avatar": ""

Media Chooser HTML

This is the basic HTML skeleton for the media chooser. Feel free to apply your own CSS rules.

<div class="chooser-container">
  <!-- header of the widget -->
  <div class="chooser-header"><div class="inner">
    Media Chooser
    <a href="" target="_blank">Powered by Chute</a>
  <!-- Main area -->
  <div class="chooser-main"><div class="inner">
    <!-- Navigation -->
    <div class="nav"><ul>
      <li class="content"><a href="#">Upload</a></li>
      <li class="facebook"><a href="#">Facebook</a></li>
      <!-- Other services -->
    <!-- Body -->
    <div class="stage split-h">
      <div class="content"></div>
      <div class="facebook content"></div>
      <!-- Other services -->
    <!-- Sidebar -->
    <div class="meta">
      <div class="meta-controls"></div>
      <div class="meta-listing"></div>
      <div class="status"></div>

Browser compatability

  • Safari 4+
  • Mozilla Firefox 3.5+
  • Opera 9+
  • Google Chrome
  • IE 8+


© Chute Corporation.