File Sharing

Share and download files using the device's native sharing dialog for seamless file distribution.

Overview

Native file sharing enables users to download files and share them through the device's built-in sharing options. Unlike web-based sharing that only shares links, this feature downloads the actual file and allows sharing through any installed app (email, messaging, cloud storage, etc.).

Prerequisites

  1. Install the Despia plugin from WeWeb Marketplace

  2. Verify installation: AssetsLibrary → check for "Despia package"

Implementation Steps

Step 1: Add Despia Plugin Component

  1. Click Add in WeWeb editor

  2. Navigate to Assets panel

  3. Drag the Despia component to the top of your page

  4. Works with new or existing pages

Step 2: Create Share Trigger

  1. Add a button element labeled "Share File"

  2. Can also trigger from:

    • Document list items

    • Image galleries

    • Download icons

    • Any interactive element

Step 3: Configure Sharing Workflow

  1. Select your trigger element

  2. Go to Workflows → Add new workflow

  3. Add action: Execute component action

    • Component: Despia plugin

    • Action: "Open native file share dialog"

    • File URL: URL of the file to share

Dynamic File URLs

The file URL can be bound dynamically to:

  • API response data

  • Collection items

  • User-generated content

  • Variable values

Supported File Types

The native share dialog handles all common file types:

Documents

  • PDF files

  • Word documents

  • Excel spreadsheets

  • Text files

Media

  • Images (JPG, PNG, GIF)

  • Videos (MP4, MOV)

  • Audio files (MP3, WAV)

Other

  • ZIP archives

  • CSV data files

  • JSON exports

  • Any downloadable file type

Platform Differences

iOS Share Sheet

  • Shows all compatible apps

  • Quick actions (Save to Files, Copy, Print)

  • AirDrop support

  • Extension support

Android Share Dialog

  • App suggestions based on file type

  • Direct share targets

  • Save to device storage

  • Share to nearby devices

Publishing & Deployment

  • Uses over-the-air updates

  • No App Store approval needed for changes

  • Instant deployment to all users

  • No rebuild required for URL changes

Key Advantages vs Web Sharing

Native File Sharing

  • Downloads actual file

  • Works with all file types

  • Direct app-to-app sharing

  • Offline access after download

Web Navigator Sharing

  • Only shares links or text

  • Limited file type support

  • Requires internet to access

  • Less integrated experience

Common Use Cases

Business Apps

  • Share invoices and receipts

  • Export reports

  • Distribute presentations

  • Send contracts

Educational

  • Download course materials

  • Share assignments

  • Export certificates

  • Distribute resources

Media Apps

  • Share edited photos

  • Export videos

  • Download audio files

  • Save creations

Productivity

  • Export data backups

  • Share project files

  • Distribute templates

  • Send documents

Best Practices

  1. File Size Considerations

    • Warn users about large files

    • Show download progress

    • Consider compression for big files

  2. Error Handling

    • Handle network failures

    • Validate URLs before sharing

    • Provide feedback on success/failure

  3. User Experience

    • Use clear action labels

    • Show file type icons

    • Indicate file sizes

    • Preview before sharing when possible

Security Considerations

  • Use HTTPS URLs for file downloads

  • Validate file sources

  • Consider authentication for sensitive files

  • Implement access controls on server

Performance Tips

  • Use CDN for file hosting

  • Implement caching strategies

  • Optimize file sizes

  • Consider progressive downloads

Troubleshooting

Share dialog not appearing:

  • Check URL is valid and accessible

  • Verify internet connection

  • Test with different file types

  • Check CORS settings if applicable

File not downloading:

  • Verify URL is direct file link

  • Check server response headers

  • Test file accessibility

  • Review file permissions

Wrong app suggestions:

  • Verify correct file extension

  • Check MIME types

  • Test with standard file formats

Need Help?

For additional support or questions, please contact our support team at support@despia.com

Updated on