When I use a form to upload a large video to the server, there is a temp.upload created in the /tmp directory. Where does this .upload created? Can I remove it after the uploading is complete? I use Django and python on ubuntun.
I check Django documentation for file upload. It says that:
“If an uploaded file is too large, Django will write the uploaded file to a temporary file stored in your system’s temporary directory. On a Unix-like platform this means you can expect Django to generate a file called something like /tmp/tmpzfp6I6.upload. If an upload is large enough, you can watch this file grow in size as Django streams the data onto disk.”
How to let Django to remove this file automatically after the uploading is complete? How can I get this temporary .upload path information ?
Thanks
If the file size is greater than 2.5MB Django will write the uploaded file to your /tmp directory (on Linux) before saving it. After the upload is complete you can remove the file manually or you can have a cron job (or something similar) to remove the temp files automatically.