Skip to content

Instantly share code, notes, and snippets.

@wwitzel3
Created July 20, 2011 14:36
Show Gist options
  • Save wwitzel3/1095075 to your computer and use it in GitHub Desktop.
Save wwitzel3/1095075 to your computer and use it in GitHub Desktop.
saving an in memory file to disk
# 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