ember-file-upload

basic ember.js django app showing file upload in action

Stars
43

ember.js web app showing file uploads in action using ember-data

To run this django application

  1. mkvirtualenv ember-file-upload
  2. pip install -r requirements.txt
  3. python manage.py syncdb --noinput
  4. python manage.py runserver
  5. http://localhost:8000/
  6. select 2 gif or jpg images and click the save button

The images are base64 decoded on the python/django side and dropped in the root project folder

On success look for logo.gif and other.gif

**Files of interest for anyone looking at the ember side of this project

https://github.com/toranb/ember-file-upload/blob/master/ember/static/script/app/person.js

  • This file contains the ember views/controllers/models/router

https://github.com/toranb/ember-file-upload/blob/master/ember/person/templates/index.html

  • This file contains the handlebars template

https://github.com/toranb/ember-file-upload/blob/master/ember/static/script/vendor/adapter.js

  • This file contains the ember-data adapter that will fire off the ajax post

https://github.com/toranb/ember-file-upload/blob/master/ember/person/views.py

  • This file contains the python view that responses to the http post (look for the class NewPerson)

**issues in the current release

1.) After a successful file upload you will see a javascript error

  • This is not an ember issue, my python view is half baked + my adapter is half baked (it does however drop a file in the root directory for each image you uploaded)

2.) This is a basic proof of concept so it's not working on IE8 but this isn't ember-data but the django-rest-framework adapter I wrote.

  • You can modify the adapter file and replace the FormData element with something more IE friendly if needed

3.) This doesn't work with png images for some odd reason