> ## 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.

# Upload and Organize Files in File Transfer Pavan

> Upload single files or collections to File Transfer Pavan with drag and drop, real-time progress, PIN or password protection, and organized Supabase storage.

File Transfer Pavan's upload service orchestrates every file upload to Supabase Storage. It validates files through a server-side RPC, generates secure share tokens, and provides two modes: single file uploads and bundled file collections. This guide covers both workflows so you can choose the right option for your needs.

<CardGroup cols={2}>
  <Card title="Single File Upload" icon="file-arrow-up">
    Upload one file at a time with optional PIN or password protection and a real-time progress bar.
  </Card>

  <Card title="File Collection" icon="files">
    Bundle multiple files into a single shareable link. Recipients download all files as a ZIP.
  </Card>
</CardGroup>

## Uploading a Single File

Use single file upload when you want to share one file quickly with a unique link.

<Steps>
  <Step title="Open the dashboard or home page">
    Navigate to the File Transfer Pavan home page or your Dashboard.
  </Step>

  <Step title="Add a file to the upload zone">
    Drag and drop a file onto the upload zone, or click the zone to open your file picker.
  </Step>

  <Step title="Set optional protection">
    Add a **numeric PIN** to restrict access to the download page, and/or a **password** for additional security. Passwords are hashed server-side with bcrypt and never stored in plain text.
  </Step>

  <Step title="Click Upload">
    The upload triggers the `validate_file_upload()` RPC to validate the file, then streams the file to Supabase Storage.
  </Step>

  <Step title="Track progress">
    A real-time progress bar shows upload speed and estimated time to completion.
  </Step>

  <Step title="Get your share link">
    On completion, a cryptographically secure share token and link are generated automatically. Copy the link from the success dialog.
  </Step>
</Steps>

## Uploading a File Collection

Use file collections when you want to share several files under one link, with a single PIN or password for the whole group.

<Steps>
  <Step title="Select multiple files">
    Choose multiple files. Up to three files upload concurrently at a time.
  </Step>

  <Step title="Name and describe the collection">
    Optionally add a collection name and description to help recipients understand the bundle.
  </Step>

  <Step title="Set collection-level protection">
    Apply a numeric PIN and/or password to the entire collection. Everyone accessing the collection uses the same credentials.
  </Step>

  <Step title="Upload">
    The system manages parallel uploads (up to three at once). Progress is shown for each file.
  </Step>

  <Step title="Share the collection link">
    After upload, you receive a single collection link. Recipients can view the file list and download everything as a ZIP archive.
  </Step>
</Steps>

## Security Options

<Note>
  **PIN protection** adds a numeric code required to access the download page. Recipients must enter the PIN at the `PinAccess.tsx` page before they can download.
</Note>

<Warning>
  **Password protection** uses bcrypt hashing on the PostgreSQL server via the `insert_file_with_password()` RPC. The password is never stored in plain text and is never hashed on the client side. Brute-force cost is set high enough to deter automated guessing.
</Warning>

**Cryptographic tokens** are URL-safe and generated using a secure random source. The system handles both standard random token generation and base64 variant encoding for compatibility across platforms and messaging apps.

## File Previews

Recipients can preview supported file types before downloading:

| File type | Preview method |
| - | - |
| PDF | Embedded viewer via react-pdf |
| Image (JPG, PNG, GIF, WebP) | Native image preview |
| Video / Audio | HTML5 `<video>` and `<audio>` player |
| Source code | Syntax-highlighted code block |
| Other | Fallback icon with filename and size |

## Upload RPC Functions

These Supabase RPC functions power the upload workflow:

| Function | Purpose |
| - | - |
| `validate_file_upload()` | Server-side validation before every upload |
| `generate_share_token()` | Creates a unique, URL-safe share token |
| `generate_share_pin()` | Generates a numeric PIN for access control |
| `insert_file_with_password()` | Stores a file record with a bcrypt-hashed password |
| `insert_collection()` | Creates a file collection record with a share token |

## Next Steps

* [Share Files with Secure Links and QR Codes](/file-transfer/sharing-files)
* [Security and Access Control](/file-transfer/security)


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