Skip to main content
Anchor Browser supports two methods for downloading files during your browser sessions:
  1. Traditional Downloads: Files are downloaded to the browser instance and then stored by Anchor for retrieval
To download PDF files directly instead of viewing them in the browser, set pdf_viewer to false when creating your session.
  1. P2P Downloads: Files are captured directly in the browser using peer-to-peer technology, available instantly without waiting for Anchor storage

Traditional File Downloads

The following examples demonstrate how to download a file using the traditional method and retrieve it from the browser session.
1

Create a browser session

Use the create session API to create a new browser session. To enable automatic PDF downloads, include the following browser configuration:
2

Browse and download a file

Use the following example to perform a file download
3

Fetch the file from the browser session

You can retrieve the downloaded file from the browser session using the get session downloads API

Keep downloads across sessions

Downloads are normally stored per session. To keep them in a folder your team owns, mount a volume into the session: every download then lands in the volume’s downloads/ folder, and any later session that mounts the same volume sees it.

P2P Downloads

For real-time download notifications and direct file streaming without waiting for Anchor storage, see the P2P Download Guide. Files are available immediately when the download completes — no polling required.