I want to save a temporary uploaded file in the django os
. How can I do that ?
The file is received as the following:
file_obj = request.FILES['document']
I tried the following method but it saves the file in my AWS account but I just want to save it in the os and delete is as soon as I am done with it.
file_name = default_storage.save(file_obj.name, file_obj)
file_url = default_storage.url(file_name)
when I pass the file_url
in a function and try to read it I get the following error:
OSError: [Errno 22] Invalid argument: 'https://xxxxxxxx.s3.amazonaws.com/media/Sample%20PFEP%20(2).xlsx'
I face no problem when I read the same file from local in my jupyter notebook. Why is that ?