def _save_local(self, temp_file, filename, obj):
path = self._get_path(filename)<EOL>if not os.path.exists(os.path.dirname(path)):<EOL><INDENT>os.makedirs(os.path.dirname(path), self.permission | <NUM_LIT>)<EOL><DEDENT>fd = open(path, '<STR_LIT:wb>')<EOL>temp_file.seek(<NUM_LIT:0>)<EOL>t = temp_file.read(<NUM_LIT>)<EOL>while t:<EOL><INDENT>fd.write(t)<EOL>t = temp_file.read(<NUM_LIT>)<EOL><DEDENT>fd.close()<EOL>if self.filesize_field:<EOL><INDENT>setattr(obj, self.filesize_field, os.path.getsize(path))<EOL><DEDENT>return filename<EOL>
Saves the specified file to the local file system.