SFTP
Connect to the designated FTP/SFTP server to upload or download files
Last updated
Connect to the designated FTP/SFTP server to upload or download files
Last updated
// List files or subfolders in the server root directory
let entries = await api.ftp.list('/')
console.log(entries)
// Download the file located at the path /download/test.png on the server to the workspace, and name it as 'file1.png'
await api.ftp.get('/download/test.png', 'file1.png')
// Change the filename of the file located at the path /download/test.png on the server
await api.ftp.rename('/download/test.png', '/download/testnew.png')
// Upload the file 'file2.pdf' located in the workspace to the server path /upload/file2.pdf
await api.ftp.put('file2.pdf', '/upload/file2.pdf')
// Create a subdirectory on the server at the path /upload/temp
await api.ftp.mkdir('/upload/temp')
// Delete the file located at the server path /upload/file2.pdf
await api.ftp.remove('/upload/file2.pdf')