I want to get some files from the user and after getting the files, I want the user should make a payment after payment is done, an order should be created and the files should be stored against that order in the Database. I know how to create an order and store the files in a database.
I have used Django's sessions to store the string data. But want to store files also. I have used the following code :
In HTML:
<form method="POST" enctype="multipart/form-data">
<input type="file" name="filename">
</form>
In views.py :
if request.method == "POST":
request.session['filename'] = request.FILES['filename']
It throws errors as : Object of type InMemoryUploadedFile is not JSON serializable