parameters: (self, filename, bucket, key,
                      callback=None, extra_args=None)
docstring: Upload a file to an S3 object.
  
          Variants have also been injected into S3 client, Bucket and Object.
          You don't have to use S3Transfer.upload_file() directly.
  
          .. seealso::
              :py:meth:`S3.Client.upload_file`
              :py:meth:`S3.Client.upload_fileobj`
docstring_summary: Upload a file to an S3 object.
docstring_tokens: Upload a file to an S3 object .
function: def upload_file(self, filename, bucket, key,
                      callback=None, extra_args=None):
          """Upload a file to an S3 object.
  
          Variants have also been injected into S3 client, Bucket and Object.
          You don't have to use S3Transfer.upload_file() directly.
  
          .. seealso::
              :py:meth:`S3.Client.upload_file`
              :py:meth:`S3.Client.upload_fileobj`
          """
          if not isinstance(filename, six.string_types):
              raise ValueError('Filename must be a string')
  
          subscribers = self._get_subscribers(callback)
          future = self._manager.upload(
              filename, bucket, key, extra_args, subscribers)
          try:
              future.result()
          # If a client error was raised, add the backwards compatibility layer
          # that raises a S3UploadFailedError. These specific errors were only
          # ever thrown for upload_parts but now can be thrown for any related
          # client error.
          except ClientError as e:
              raise S3UploadFailedError(
                  "Failed to upload %s to %s: %s" % (
                      filename, '/'.join([bucket, key]), e))
function_tokens: def upload_file ( self , filename , bucket , key , callback = None , extra_args = None ) : if not isinstance ( filename , six . string_types ) : raise ValueError ( 'Filename must be a string' ) subscribers = self . _get_subscribers ( callback ) future = self . _manager . upload ( filename , bucket , key , extra_args , subscribers ) try : future . result ( ) # If a client error was raised, add the backwards compatibility layer # that raises a S3UploadFailedError. These specific errors were only # ever thrown for upload_parts but now can be thrown for any related # client error. except ClientError as e : raise S3UploadFailedError ( "Failed to upload %s to %s: %s" % ( filename , '/' . join ( [ bucket , key ] ) , e ) )