Skip to main content
This example demonstrates comprehensive file operations including uploads, downloads, directory management, and file search.

What You’ll Learn

  • Creating directories in sandboxes
  • Uploading files from local paths and memory
  • Downloading files to local paths or memory
  • Searching and listing files
  • Replacing content in files
  • Managing file permissions

Complete Example

Expected Output

Key Concepts

Upload Strategies

You can upload files from different sources:

Download Strategies

Download files to different destinations:

Searching Files

Use glob patterns to search for files:

Replacing Content

Search and replace across multiple files:

Best Practices

Batch uploads: Use uploadFiles() for multiple files instead of multiple uploadFile() calls for better performance.
File permissions: When uploading scripts, remember to set execute permissions using chmod or specify permissions during upload.
Path handling: Always use absolute paths or paths relative to the sandbox’s working directory to avoid ambiguity.

Next Steps

Git Workflow

Clone repositories and work with Git

Code Execution

Run code in your sandboxes