> ## Documentation Index
> Fetch the complete documentation index at: https://pavan-c90e8846.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Share Files with Secure Links and QR Codes

> Generate secure shareable links and QR codes for files and collections, control access with PIN and passwords, and track downloads in File Transfer Pavan.

Every completed upload in File Transfer Pavan receives a unique, cryptographically secure token. You can share that token as a direct link, a QR code, or a collection bundle. This guide covers how to distribute files, how recipients access them, and how to track download activity through the analytics dashboard.

## Getting a Share Link

<Steps>
  <Step title="Copy from the upload success dialog">
    After an upload completes, the success dialog shows the generated share link. Click **Copy Link** to copy it to your clipboard.
  </Step>

  <Step title="Copy from the Dashboard">
    Alternatively, go to your Dashboard, find the file or collection in the list, and click **Copy Link** next to the item.
  </Step>

  <Step title="Regenerate a PIN (optional)">
    If you want to change the access PIN, open the item in the Dashboard and click **Regenerate PIN**.
  </Step>
</Steps>

## Sharing via QR Code

<Steps>
  <Step title="Open the QR code view">
    After upload or from the Dashboard, click the **QR Code** icon next to the file or collection.
  </Step>

  <Step title="Generate the code">
    A QR code is generated from the share link automatically.
  </Step>

  <Step title="Download or print">
    Click **Download QR** to save the image, or print it for physical distribution.
  </Step>

  <Step title="Scan to access">
    Recipients can scan the code with the built-in ScanQR page or any standard camera app.
  </Step>
</Steps>

## Accessing a Shared File

From the recipient's perspective, downloading a shared file works like this:

<Steps>
  <Step title="Visit the share link">
    The recipient opens the share link in their browser.
  </Step>

  <Step title="Enter PIN if required">
    If the file is PIN protected, the recipient is redirected to the `PinAccess.tsx` page and must enter the numeric PIN.
  </Step>

  <Step title="Enter password if required">
    If the file is password protected, a password prompt appears. The submitted password is validated via the `validate_file_password()` RPC.
  </Step>

  <Step title="Download">
    After authentication, a download button appears. Clicking it triggers the download and increments the download count via `increment_file_download_count()`.
  </Step>
</Steps>

## Collection Sharing

A file collection is shared with a single link. Recipients who open the link see the full list of files in the collection. They can download individual files or use the **Download All** option to fetch everything packaged as a ZIP archive. Collection access is mediated by `downloadCollection(shareToken)`.

## Download Tracking

File Transfer Pavan records anonymous download analytics for every shared item:

* Each file download increments the `download_count` field
* Detailed records are stored in the `download_history` table, including the IP address and user agent of the downloader
* The app does not require the downloader to sign in, so metrics remain anonymous and privacy-focused

View aggregated statistics from your Dashboard under the Analytics tab.

## Sharing RPC Functions

The sharing and access workflow is backed by the following RPC functions:

| Function | Purpose |
| - | - |
| `get_file_by_token()` | Retrieve a file record by its share token |
| `get_file_by_pin()` | Retrieve a file record by its numeric PIN |
| `get_collection_by_pin()` | Retrieve a collection record by its PIN |
| `validate_file_password()` | Compare a submitted password against the bcrypt hash |
| `increment_file_download_count()` | Increment the download counter for a single file |
| `increment_collection_download_count()` | Increment the download counter for a collection |

## Next Steps

* [Upload and Organize Files](/file-transfer/uploading-files)
* [Security and Access Control](/file-transfer/security)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.