Skip to main content
Download and access the actual content of your stored files for processing, analysis, or integration with your applications.

Download File Content

Retrieve file content:
  • CLI
  • Python SDK
  • JavaScript SDK
gravixlayer files download file-abc123def456 --output downloaded.pdf
Download by filename:
gravixlayer files download README.md --output test_readme.md
Example Output:
 Downloading file: README.md
   Looking up file by name...
   Found file ID: a804e4a3-ea8b-4ac7-855b-c7977f9d0ed4
✅ File downloaded to: test_readme.md

Download Multiple Files

  • CLI
  • Python SDK
  • JavaScript SDK
Download by file ID:
gravixlayer files download file-abc123def456 --output downloaded.pdf
Download by filename:
gravixlayer files download document.pdf --output copy.pdf
Download without specifying output (uses original filename):
gravixlayer files download file-abc123def456

Stream Large Files

  • Python SDK
  • JavaScript SDK
import os
from gravixlayer import GravixLayer

client = GravixLayer()

def download_large_file(file_id, output_path):
    """Download large files with progress tracking"""
    try:
        # Get file info first
        file_info = client.files.retrieve(file_id)
        print(f"Downloading {file_info.filename} ({file_info.bytes} bytes)...")
        
        # Download content
        content = client.files.content(file_id)
        
        # Write to file
        with open(output_path, "wb") as f:
            f.write(content)
        
        print(f"✅ Downloaded to: {output_path}")
        return True
        
    except Exception as e:
        print(f"❌ Download failed: {e}")
        return False

# Download a large file
success = download_large_file("your-large-file-id", "large_file.pdf")

Download Parameters

ParameterTypeRequiredDescription
file_id_or_namestringYesFile ID or filename
--outputstringNoOutput filename (defaults to original name)
I