2👍
✅
You need to use .encode() to encode the string:
file.save(filename.encode('utf-8', 'ignore'), file, save=True)
0👍
In your FileField definition the ‘upload_to’ argument might be like os.path.join(u’uploaded’, ‘files’, ‘%Y’, ‘%m’, ‘%d’)
(see the first u’uploaded’ started with u’) so all string will be of type unicode and this may help you.
- [Answered ]-Unable to use JSON.parse in my django template
- [Answered ]-Getting error on redirect django
- [Answered ]-DRF – Filters in ModelSerializer
- [Answered ]-Django URL to View mapping
- [Answered ]-Django JSONField
Source:stackexchange.com