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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -