I also started with base64 uploading, but it becomes quickly a pain when users are uploading files > 5MB on a slow connections as this can block one entire rails worker for multiple minutes.
Our current solution is to let users upload directly to S3 and then send us the resulting url, which allows bigger file uploads and is way faster then the base64 solution.
To achieve this, we have an
uploads rest endpoint, which generates the presigned post to the s3 bucket and an ember data model uploading the file.
App.Upload = DS.Model.extend
upload: (file) ->
resolver = Ember.RSVP.defer()
formData = new FormData()
@get('fields').forEach (key, value) ->
xhr = $.ajaxSettings.xhr()
xhr.upload.onprogress = (e) ->
percent = (e.position/ e.totalSize)
fail: (e, data) ->
success: (result) ->