Ticket #8204: 8204.storage_save.2.diff
File 8204.storage_save.2.diff, 1.0 KB (added by , 16 years ago) |
---|
-
django/django/core/files/storage.py
153 153 # This file has a file path that we can move. 154 154 file_move_safe(content.temporary_file_path(), full_path) 155 155 content.close() 156 el se:156 elif hasattr(content, 'chunks'): 157 157 # This is a normal uploadedfile that we can stream. 158 158 fp = open(full_path, 'wb') 159 159 locks.lock(fp, locks.LOCK_EX) … … 161 161 fp.write(chunk) 162 162 locks.unlock(fp) 163 163 fp.close() 164 elif hasattr(content, 'save'): 165 # Fallback for other types of content (e.g. PIL Image) 166 content.save(full_path) 167 else: 168 raise SuspiciousOperation("Unknown file content type.") 164 169 165 170 def delete(self, name): 166 171 name = self.path(name)