2👍
✅
If you want to get the content of uploaded file, you can directly use the .read()
api.
You are assigning jsonData
to None
and then trying to call encode()
method of it, which is incorrect.
Something like:
if request.FILES.has_key('data'):
file = request.Files['data']
data = file.read()
#you have file contents in data
Source:stackexchange.com