Operations (sample payloads)

Main operations

FTP delete

Delete a file using FTP. Sample Input

{
    "path": "/documents/report.pdf"
}

Sample Output

{
    "deleted": true
}

FTP download

Download a file using FTP. Sample Input

\{
    "path": "/documents/report.pdf",
    "debug": false
\}

Sample Output

{
    "file": \{
        "name": "report.pdf",
        "url": "https://example.com/temporary-download-link/report.pdf",
        "mime_type": "application/pdf",
        "expires": 1623456789
    \}
}

FTP list files

List all accessible files in a directory. Sample Input

{
    "path": "/documents"
}

Sample Output

{
    "files": [
        \{
            "file_name": "report.pdf",
            "path": "/documents/report.pdf"
        \},
        \{
            "file_name": "presentation.pptx",
            "path": "/documents/presentation.pptx"
        \},
        \{
            "file_name": "data.xlsx",
            "path": "/documents/data.xlsx"
        \},
        \{
            "file_name": "image.jpg",
            "path": "/documents/image.jpg"
        \}
    ]
}

FTP move

Move (or rename) a file using FTP. Sample Input

\{
    "old_path": "/documents/report_2023.pdf",
    "new_path": "/archive/2023/annual_report.pdf"
\}

Sample Output

{
    "moved": true
}

FTP upload

Upload a file using FTP. Sample Input

{
    "file": \{
        "name": "example.txt",
        "content": "SGVsbG8gV29ybGQh",
        "mime_type": "text/plain"
    \},
    "path": "/uploads/example.txt",
    "include_detailed_error": true
}

Sample Output

{
    "file": \{
        "name": "example.txt",
        "url": "ftp://ftp.example.com/uploads/example.txt",
        "mime_type": "text/plain",
        "expires": 1672531200
    \}
}

SFTP check file exists

Check whether a file exists with partial or full file name. Sample Input

\{
    "path": "/documents/reports",
    "file_name": "monthly_report"
\}

Sample Output

{
    "Found": true
}

SFTP delete

Delete a file using SFTP (ssh). Sample Input

{
    "path": "/home/user/documents/report.pdf"
}

Sample Output

{
    "deleted": true
}

SFTP download

Download a file using SFTP (ssh). Sample Input

\{
    "path": "/documents/report.pdf",
    "debug": false
\}

Sample Output

{
    "file": \{
        "name": "report.pdf",
        "url": "https://example.com/temporary-download-link/report.pdf",
        "mime_type": "application/pdf",
        "expires": 1623456789
    \}
}

SFTP list directories

List all accessible subdirectories in a directory. Sample Input

{
    "path": "/home/user/documents"
}

Sample Output

{
    "directories": [
        \{
            "directory_name": "projects",
            "path": "/home/user/documents/projects"
        \},
        \{
            "directory_name": "reports",
            "path": "/home/user/documents/reports"
        \},
        \{
            "directory_name": "images",
            "path": "/home/user/documents/images"
        \},
        \{
            "directory_name": "backups",
            "path": "/home/user/documents/backups"
        \}
    ]
}

SFTP list files

List all accessible files in a directory. Sample Input

\{
    "path": "/documents",
    "file_extension": ".pdf",
    "file_name": "report"
\}

Sample Output

{
    "files": [
        \{
            "file_name": "annual_report_2023.pdf",
            "path": "/documents/annual_report_2023.pdf"
        \},
        \{
            "file_name": "quarterly_report_Q2.pdf",
            "path": "/documents/quarterly_report_Q2.pdf"
        \},
        \{
            "file_name": "financial_report_2023.pdf",
            "path": "/documents/financial_report_2023.pdf"
        \}
    ]
}

SFTP move

Move (or rename) a file using SFTP (ssh). Sample Input

\{
    "old_path": "/documents/report_2023.pdf",
    "new_path": "/archive/2023/annual_report.pdf"
\}

Sample Output

{
    "moved": true
}

SFTP upload

Upload a file using SFTP (ssh). Sample Input

{
    "file": \{
        "name": "example.txt",
        "content": "This is the content of the file to be uploaded."
    \},
    "path": "/remote/directory/example.txt",
    "stream": true,
    "buffer_size": 65536,
    "debug": false,
    "concurrency": 64,
    "include_detailed_error": false
}

Sample Output

\{
    "uploaded": true,
    "connectionLogs": [
        "Connecting to SFTP server...",
        "Authentication successful",
        "Uploading file: /remote/directory/example.txt",
        "File upload completed successfully",
        "SFTP connection closed"
    ]
\}

Was this page helpful?