Onboarding Guide
Get started with PreviewFile.dev - three ways to create secure preview links
Onboarding Guide
PreviewFile.dev offers three core ways to create secure preview links for your files and URLs. Whether you're a casual user, business user, or developer, you can get started quickly.
New to PreviewFile? This guide will walk you through all three usage scenarios with practical examples.
Scenario 1: Direct URL Preview (No Login Required)
Use Case: Quickly share any web resource (images, videos, PDFs, etc.) while hiding the original URL
How It Works
-
Visit the URL shortening endpoint
https://previewfile.dev/u?url=[YOUR_ORIGINAL_URL]Example:
https://previewfile.dev/u?url=https://example.com/sensitive-document.pdf -
Get your preview link
- System automatically generates a short link:
/p/abc123xyz - Full preview link:
https://previewfile.dev/p/abc123xyz
- System automatically generates a short link:
-
Share with others
- Recipients can view the content by visiting
/p/abc123xyz - Original URL is completely hidden
- Link expires based on configured duration (default 1 hour)
- Recipients can view the content by visiting
Example Use Case
Scenario: Share internal company report without exposing S3 storage path
# Enter in browser
https://previewfile.dev/u?url=https://s3.company.com/reports/Q3-2025.pdf
# Returns short link
https://previewfile.dev/p/x7k2m9n
# Share short link with team membersBenefits
- ✅ No registration or login required
- ✅ Instant preview link generation
- ✅ Hide original resource address
- ✅ Automatic expiration protection
Scenario 2: Browser File Upload (Login Required)
Use Case: Upload local files for online preview with advanced security policies
How It Works
-
Visit homepage
- Go to
https://previewfile.dev - See file upload component
- Go to
-
Drag/select file
- Drag and drop file to upload area
- Or click "Upload File" button to select
-
Login prompt
- System prompts for login on first upload
- Supports GitHub / Google / Email quick login
-
Configure preview policies (optional)
- Link Validity: Set expiration time (15 minutes to 7 days, plan limits apply, default 1 hour)
- Dynamic Watermark: Add watermark text
- No Download: Disable download, view-only
- One-Time Link: Link expires after one view
-
Generate preview link
- Click "Guard Your Files with Effortless Previews"
- Get
/p/[shortUrl]format preview address
-
Manage history
- View all created preview sessions in Dashboard
- Manually delete or wait for automatic expiration
Example Use Case
Scenario: Designer shares design with client, view-only, no download
- Upload
design-final.psd - Check "No Download"
- Set "Dynamic Watermark" to "Client Preview Only"
- Set validity to 24 hours
- Get link:
https://previewfile.dev/p/d3s1gn42 - Client can only view online, cannot download original file
Benefits
- ✅ Support local file upload
- ✅ Flexible security policy configuration
- ✅ Manage all preview records after login
- ✅ Suitable for internal enterprise collaboration
Scenario 3: Developer API Integration
Use Case: Integrate file preview functionality in applications, batch generate preview links
API Endpoint
POST /api/u
Content-Type: application/json
x-api-key: YOUR_API_KEYRequest Parameters
{
"url": "https://example.com/document.pdf",
"ttlMinutes": 60,
"watermark": "Confidential",
"noDownload": true,
"oneTime": false
}Response Example
{
"success": true,
"data": {
"shortUrl": "a1b2c3d4",
"previewUrl": "https://previewfile.dev/p/a1b2c3d4",
"expireAt": "2025-10-02T15:30:00Z",
"status": "READY"
}
}Integration Examples
Node.js
const fetch = require('node-fetch');
async function createPreview(originalUrl) {
const response = await fetch('https://previewfile.dev/api/u', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.PREVIEWFILE_API_KEY}`
},
body: JSON.stringify({
url: originalUrl,
ttlMinutes: 120,
noDownload: true
})
});
const result = await response.json();
return result.data.previewUrl;
}
// Usage
const previewLink = await createPreview('https://cdn.company.com/invoice-2025.pdf');
console.log('Preview link:', previewLink);Python
import requests
def create_preview(original_url):
response = requests.post(
'https://previewfile.dev/api/u',
headers={
'Content-Type': 'application/json',
'Authorization': f'Bearer {API_KEY}'
},
json={
'url': original_url,
'ttlMinutes': 120,
'noDownload': True
}
)
data = response.json()
return data['data']['previewUrl']
# Usage
preview_link = create_preview('https://cdn.company.com/invoice-2025.pdf')
print(f'Preview link: {preview_link}')Application Scenarios
-
SaaS Application Integration
- Auto-generate preview links after user uploads
- Include temporary preview address in email notifications
-
Customer Relationship Management (CRM)
- Share contracts, invoices with customers
- Automatically set expiration and download restrictions
-
Internal Collaboration Tools
- Batch generate preview links for team documents
- Centrally manage permissions and validity
Benefits
- ✅ RESTful API, easy to integrate
- ✅ Support batch operations
- ✅ Complete error handling and retry mechanism
- ✅ Seamless integration with existing systems
Security Policies Explained
1. TTL (Time To Live)
- Configurable from 15 minutes to 7 days (plan limits apply, default 1 hour)
- Link automatically expires after TTL
- Use case: Temporary sharing, sensitive documents
2. Dynamic Watermark
- Overlay text watermark on preview page
- Can set username, timestamp, etc.
- Use case: Copyright protection, internal audit
3. No Download
- Users can only view online, cannot save locally
- Blocks right-click save, drag download, etc.
- Use case: Design review, contract preview
4. One-Time Link
- Expires immediately after one access
- Use case: Password transmission, temporary authorization
FAQ
Q1: Are there limits for free users?
A: Free users get 10 preview quota per month, max 10MB per file, max 24-hour link validity.
Q2: Where are uploaded files stored?
A: Files are encrypted and stored in the cloud, automatically deleted after expiration. Paid users can choose private deployment.
Q3: Can preview links be modified?
A: Modification not supported, but you can delete old link and regenerate.
Q4: What file types are supported?
A: Images (JPG/PNG/GIF/WebP), PDF, videos (MP4/WebM), Office documents, and more.
Q5: Are there API rate limits?
A: Free users: 10/day, paid users: 100-10000/day depending on plan.
Next Steps
- 📖 View API Documentation for complete endpoints
- 🔒 Read Security Policies for data protection details
- 💰 Visit Pricing Page to choose the right plan
- 🚀 See the Release Notes for what has shipped
Need Help? Contact us: [email protected]