uploading images via API

186 views
Skip to first unread message

Bastian

unread,
May 29, 2012, 12:50:46 PM5/29/12
to django...@googlegroups.com
Hi,

I have a view where a user can upload an image via the web interface. Now I would like to play with uploading the images via an API from phones and such. I use Tastypie for other endpoints but it looks like it does not really support images yet. So I'm looking for advices as to the road to follow. I don't know if using a branch of Tastypie that handles images, or using another API or just building my own view for that purpose, does it even have to be RESTful?
If anybody wants to share some experience I'll be glad to read it.
Thanks,
Bastian

Aljoša Mohorović

unread,
Jun 4, 2012, 11:05:35 AM6/4/12
to django...@googlegroups.com
take a look at gist w/ base64 file upload solution:
https://github.com/toastdriven/django-tastypie/issues/42

it works great, you can add Base64FileField implementation to your app
(it's only ~15 lines of code) and you can upload from anything that
can open a file and encode it.
you can also use flash/swf if you need to make it work in older browsers.

Aljosa
Reply all
Reply to author
Forward
0 new messages