FileSystemStorage should make it easy to save other types of files
|Reported by:||Julien Phalip||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
It is quite common to use PIL to modify an uploaded image, e.g. create a thumbnail:
from PIL import Image uploaded_image = Image.open(StringIO.StringIO(uploaded_file.read())) ... # Modify image, e.g. create thumbnail uploaded_image.save('/blah/image.gif') thumbnail_image.save('/blah/image_thumbnail.gif')
Now that the new file storage system has been merged in trunk, I could not find any easy way to use
FileSystemStorage for saving PIL images. The problem is that
FileSystemStorage assumes that it's given
TemporaryUploadedFile (for example).
It seems quite essential that there should be a fall back option to manage other kinds of file content.