开发者

Best Approach to process images in Django

I've have an application with Android front end and Django as the back end. As part of the answers here, I'm confused over the approach which I should take to send images to Django Server. I've 2 options at my disposal as Piro pointed out there.

1) Sending images as Multi Part entity

2) Send image as a String after encoding it using Base 64.

My knowledge in Django is limited and So I 开发者_开发技巧need guidance on whether which of the approaches would make it easier for the images to be processed by Django. The images are small in size (<200kb) and number (<10). Any suggestions or pointers are most welcome.


Send it as multipart. I see no benefits to using Base64 here. It just uses unnecessary time and bandwidth. HTTP is perfectly capable of safely transferring binary files. Of course, multipart is designed so you can send multiple parts, each with clearly specified mime types. So you can send one application/json part with another that's image/png.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜