respondcreate / django-versatileimagefield

A drop-in replacement for django's ImageField that provides a flexible, intuitive and easily-extensible interface for quickly creating new images from the one assigned to the field.
http://django-versatileimagefield.readthedocs.io/
MIT License
531 stars 88 forks source link

error to upload images using django-rest and angular #187

Closed juanbits closed 3 years ago

juanbits commented 3 years ago

i have problems to use django-versatileimagefield with the REST Framework, because i try to send the files using angular (POST method) and i got some of the next errors:

The submitted data was not a file. Check the encoding type on the form.

or

Upload a valid image. The file you uploaded was either not an image or a corrupted image

On this topoc https://stackoverflow.com/a/28036805/8414875 I see the REST framework is expecting a file multipart/form-data but with angular is not possible send this kind of file, but I can send a base64 imagem that cannot be proccessed by django-versatileimagefield

respondcreate commented 3 years ago

Hey @juanremi ! Closing as this not an issue specific to django-versatileimagefield but it looks like you could solve your issue by updating your view code to process the expected filetype: https://stackoverflow.com/a/28036989/1149774