#NEWLINE# def _handle_uploaded_file( self , field_name ) : #NEWLINE# #INDENT# 'Process an uploaded file' #NEWLINE# try : #NEWLINE# #INDENT# file = self . files [ filepath ] #NEWLINE# filepath = self . _get_upload_name ( file . name ) #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# return '' #NEWLINE# #UNINDENT# destination = open ( ( settings . MEDIA_ROOT + filepath ) , 'wb+' ) #NEWLINE# for chunk in file . chunks ( ) : #NEWLINE# #INDENT# destination . write ( chunk ) #NEWLINE# destination . close ( ) #NEWLINE# #UNINDENT# return ( settings . MEDIA_URL + filepath )