- Newest
- Most votes
- Most comments
Take this:
-
Create the Directory: Use the CreateDirectory method to create the directory on the SFTP server.
-
Start File Transfer: Once the directory is created, you can proceed with the StartFileTransferCommand to transfer files to the newly created directory.
import boto3
# Create an SFTP client
sftp_client = boto3.client('transfer')
# Create the directory
sftp_client.create_directory(
ServerId='your-server-id',
DirectoryPath='/path/to/your/directory'
)
# Start file transfer
transfer_client = boto3.client('transfer')
transfer_client.start_file_transfer(
ServerId='your-server-id',
RemoteDirectoryPath='/path/to/your/directory',
LocalFilePath='/path/to/your/local/file',
# Additional parameters as needed
)
Remark: Make sure to replace 'your-server-id', '/path/to/your/directory', and '/path/to/your/local/file' with your owns.
Hello! Currently SFTP connectors from AWS Transfer Family do not support creating new folders on remote SFTP servers. However, the service team is working on multiple feature enhancements to support such operations. Please reach out to the AWS Transfer family service team via AWS support or your AWS account team to discuss your use-case requirements and the service roadmap.
Relevant content
asked 4 years ago
asked 5 years ago
- AWS OFFICIALUpdated 2 years ago

can you include the link to the documentation for the create_directory method? I don’t see it in JavaScript v3 sdk (or in the boto3/api/cli documentation for that matter) Also serverid isn’t available for start_file_transfer its connectorid