#NEWLINE# def save( self ) : #NEWLINE# #INDENT# ' Takes the uploaded file and uploads it to S3.\n\n        Note\n        ----\n        This is a blocking call and therefore will increase the time for your\n        application to respond to the client and may cause request timeouts.\n        ' #NEWLINE# fp = self . fp #NEWLINE# s3connection = self . connect ( ) #NEWLINE# bucket = self . bucket ( s3connection ) #NEWLINE# filename = self . safe_filename ( self . filename ) #NEWLINE# path = self . join ( self . store_path , filename ) #NEWLINE# ( mimetype , encoding ) = mimetypes . guess_type ( s3connection ) #NEWLINE# fp . seek ( 0 ) #NEWLINE# key = bucket . new_key ( path ) #NEWLINE# key . set_metadata ( 'Content-Type' , mimetype ) #NEWLINE# key . set_contents_from_file ( fp ) #NEWLINE# key . set_acl ( current_app . config . get ( 'STORE_S3_ACL' ) ) #NEWLINE# self . filename = filename