Created
July 20, 2011 14:36
-
-
Save wwitzel3/1095075 to your computer and use it in GitHub Desktop.
saving an in memory file to disk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Minus some boiler plate for validity and variable setup. | |
import os | |
import shutil | |
memory_file = request.POST['upload'] | |
disk_file = open(os.path.join(save_folder, save_name),'w') | |
shutil.copyfileobj(memory_file.file, disk_file) | |
disk_file.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment