Skip to main content
Download files from sandboxes to your local filesystem. This is useful for retrieving generated outputs, results, plots, or any files created in your sandbox.

Overview

File downloading is essential for:
  • Retrieving generated outputs and results
  • Saving plots and visualizations
  • Downloading processed data files
  • Archiving sandbox contents
Download supports both text and binary files. Large files may take longer to download - set appropriate timeouts for large transfers.

Basic Download

Download a file from sandbox to local:

Download with Timeout

Set timeout for large file downloads:

Download Binary Files

Download binary files (images, PDFs, etc.):

Download Multiple Files

Download multiple files:

Download All Files in Directory

Download all files from a directory:

Error Handling

Handle download errors:

Complete Example

Here’s a complete download workflow:

Best Practices

1

1. Check File Existence

Use files.exists() before downloading to avoid errors, or handle FileNotFoundError appropriately.
2

2. Set Timeouts for Large Files

For large files, set extended timeouts (60+ seconds) to avoid connection timeouts.
3

3. Create Local Directories

Create local directories before downloading to ensure files are saved correctly.
4

4. Handle Errors Gracefully

Wrap downloads in try/catch blocks to handle network errors, file not found, etc.
5

5. Verify Downloads

After downloading, verify files exist locally and check their sizes to ensure successful transfer.

Next Steps