[Answer]-Having problems with Image File POST to Django Server through API

0👍

I figured out the solution to my issue which was a faulty curl command in the file directory.

👤Jack

1👍

Don’t try to post an image in Tastypie JSON format. Upload it using a multi-part form data in plain Django. I am saying so not because you can’t do, but coz its difficult and not the right approach also. Secondly it increases the uploaded file-size 30%-40% which might be a problem to most people.

Still I leave it to you decide what to do and I am putting links for file uploading using Django and Tastypie both. Make your choice.

Plain django – https://docs.djangoproject.com/en/dev/topics/http/file-uploads/
This is straight from Django docs and mostly sufficient for any basic needs.

Using Tastypie- Django-tastypie: Any example on file upload in POST?
How do you upload a file with a POST request on django-tastypie?

Leave a comment