jquery - Posting images from src to server -
i have form below, want post image file src of img, should do?
<form style="width: 205px; height: 205px; float: left;" method="post" action="/3/edit_profile/" enctype="multipart/form-data"> <input type="hidden" name="csrfmiddlewaretoken" value="uw4ryssp..."> <img id="cropped_0" src="data:image/png;base64,ivbo..."> </form>
so think want store image in database. can pass src
of image django view(using hidden input). in django view
import requests img = requests.get(src)
then can access image content img.content
, store in database
Comments
Post a Comment