:doc:`Transfer <../../transfer>` / Client / start_file_transfer

*******************
start_file_transfer
*******************



.. py:method:: Transfer.Client.start_file_transfer(**kwargs)

  

  Begins a file transfer between local Amazon Web Services storage and a remote AS2 or SFTP server.

   

  
  * For an AS2 connector, you specify the ``ConnectorId`` and one or more ``SendFilePaths`` to identify the files you want to transfer.
   
  * For an SFTP connector, the file transfer can be either outbound or inbound. In both cases, you specify the ``ConnectorId``. Depending on the direction of the transfer, you also specify the following items: 

    
    * If you are transferring file from a partner's SFTP server to Amazon Web Services storage, you specify one or more ``RetrieveFilePaths`` to identify the files you want to transfer, and a ``LocalDirectoryPath`` to specify the destination folder.
     
    * If you are transferring file to a partner's SFTP server from Amazon Web Services storage, you specify one or more ``SendFilePaths`` to identify the files you want to transfer, and a ``RemoteDirectoryPath`` to specify the destination folder.
    

  
  

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/transfer-2018-11-05/StartFileTransfer>`_  


  **Request Syntax**
  ::

    response = client.start_file_transfer(
        ConnectorId='string',
        SendFilePaths=[
            'string',
        ],
        RetrieveFilePaths=[
            'string',
        ],
        LocalDirectoryPath='string',
        RemoteDirectoryPath='string',
        CustomHttpHeaders=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    )
    
  :type ConnectorId: string
  :param ConnectorId: **[REQUIRED]** 

    The unique identifier for the connector.

    

  
  :type SendFilePaths: list
  :param SendFilePaths: 

    One or more source paths for the Amazon S3 storage. Each string represents a source file path for one outbound file transfer. For example, ``amzn-s3-demo-bucket/myfile.txt ``.

     

    .. note::

      

      Replace ``amzn-s3-demo-bucket`` with one of your actual buckets.

      

    

  
    - *(string) --* 

    

  :type RetrieveFilePaths: list
  :param RetrieveFilePaths: 

    One or more source paths for the partner's SFTP server. Each string represents a source file path for one inbound file transfer.

    

  
    - *(string) --* 

    

  :type LocalDirectoryPath: string
  :param LocalDirectoryPath: 

    For an inbound transfer, the ``LocaDirectoryPath`` specifies the destination for one or more files that are transferred from the partner's SFTP server.

    

  
  :type RemoteDirectoryPath: string
  :param RemoteDirectoryPath: 

    For an outbound transfer, the ``RemoteDirectoryPath`` specifies the destination for one or more files that are transferred to the partner's SFTP server. If you don't specify a ``RemoteDirectoryPath``, the destination for transferred files is the SFTP user's home directory.

    

  
  :type CustomHttpHeaders: list
  :param CustomHttpHeaders: 

    An array of key-value pairs that represent custom HTTP headers to include in AS2 messages. These headers are added to the AS2 message when sending files to your trading partner.

    

  
    - *(dict) --* 

      Represents a custom HTTP header that can be included in AS2 messages. Each header consists of a key-value pair.

      

    
      - **Key** *(string) --* 

        The name of the custom HTTP header.

        

      
      - **Value** *(string) --* 

        The value of the custom HTTP header.

        

      
    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'TransferId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **TransferId** *(string) --* 

        Returns the unique identifier for the file transfer.

        
  
  **Exceptions**
  
  *   :py:class:`Transfer.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`Transfer.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`Transfer.Client.exceptions.ThrottlingException`

  
  *   :py:class:`Transfer.Client.exceptions.InternalServiceError`

  
  *   :py:class:`Transfer.Client.exceptions.ServiceUnavailableException`

  