Skip to content

File Operations

Temp edited this page Oct 23, 2025 · 11 revisions

File Operations

Complete guide to uploading, downloading, and managing files in R2-Manager-Worker.

File Operations Overview

R2-Manager-Worker supports:

  • 📤 Upload - Single or multiple files
  • 📥 Download - Individual files or bulk ZIP archives
  • 🔗 Share - Generate signed URLs for easy sharing
  • 🔄 Move - Transfer files between buckets
  • 📋 Copy - Duplicate files across buckets
  • 🗑️ Delete - Remove single or multiple files
  • 📁 Folder Navigation - Browse files within folders (see Folder Management)

Uploading Files

Via Web UI

Single File Upload:

  1. Select a bucket from the sidebar
  2. Click Upload File button
  3. Choose a file from your computer
  4. Upload begins automatically

Multiple File Upload:

  1. Click Upload Multiple Files
  2. Select multiple files at once
  3. All files upload in parallel

Drag & Drop:

  1. Drag files directly into the browser window
  2. Files automatically upload to selected bucket

Upload Progress

  • See real-time upload progress
  • Pause individual uploads
  • Resume interrupted uploads
  • Cancel uploads at any time

File Size Limits

Application supports up to 500MB per file, but Cloudflare enforces plan-based limits:

Plan Limit
Free/Pro 100MB
Business 200MB
Enterprise 500MB

Note: Upgrade your Cloudflare plan to increase limits.

Chunked Uploads

The application automatically splits large files:

  • Chunk size: 10MB per chunk
  • Auto-retry: Failed chunks retry automatically
  • Resume: Can resume interrupted uploads
  • Transparent: You don't need to do anything!

Via API

curl -X POST https://YOUR_DOMAIN/api/files/my-bucket/upload \
  -H "X-File-Name: myfile.pdf" \
  -F "file=@myfile.pdf"

For chunked uploads:

curl -X POST https://YOUR_DOMAIN/api/files/my-bucket/upload \
  -H "X-File-Name: large-file.zip" \
  -H "X-Chunk-Index: 0" \
  -H "X-Total-Chunks: 5" \
  -F "file=@chunk-0.bin"

Downloading Files

Via Web UI

Single File Download:

  1. Select a bucket
  2. Find the file in the list
  3. Click the Download icon
  4. File saves to your Downloads folder

Multiple Files as ZIP:

  1. Select multiple files (checkboxes)
  2. Click Download as ZIP
  3. All files packaged and downloaded

Download Speeds

Downloads use Cloudflare's edge network:

  • Global CDN for fast delivery
  • Automatic caching
  • Optimized routing

Via API

Single File:

curl https://YOUR_DOMAIN/api/files/my-bucket/download/myfile.pdf \
  -o myfile.pdf

ZIP Archive:

curl -X POST https://YOUR_DOMAIN/api/files/my-bucket/download-zip \
  -H "Content-Type: application/json" \
  -d '{"files": ["file1.pdf", "file2.jpg"]}' \
  -o archive.zip

Sharing Files

Generate Signed URLs

Via Web UI (Grid View):

  1. Hover over a file
  2. Click the 🔗 Link icon in top-right corner
  3. Signed URL copied to clipboard

Via Web UI (List View):

  1. Find file in the list
  2. Click Copy Link button
  3. Share URL with anyone

How Signed URLs Work

Signed URLs include:

  • HMAC-SHA256 signature for validation
  • Timestamp for uniqueness
  • File path in signature

Features:

  • ✅ Anyone can download with the link (no login required)
  • ✅ Links remain valid indefinitely
  • ✅ Signature prevents tampering
  • ✅ Each file gets unique signed URL

Share With Others

  1. Generate a signed URL
  2. Copy to clipboard (automatic)
  3. Send via email, chat, or messaging app
  4. Recipient clicks link to download

Via API

curl https://YOUR_DOMAIN/api/files/my-bucket/signed-url/myfile.pdf

Response:

{
  "success": true,
  "url": "https://your-domain.com/api/files/my-bucket/download/myfile.pdf?ts=123456&sig=abc123"
}

Moving Files

Move files between buckets (removes from source).

Via Web UI

  1. Right-click a file
  2. Select Move
  3. Choose destination bucket
  4. Confirm

File is removed from source bucket after successful move.

Via API

curl -X POST https://YOUR_DOMAIN/api/files/source-bucket/myfile.pdf/move \
  -H "Content-Type: application/json" \
  -d '{"destinationBucket": "dest-bucket"}'

Copying Files

Copy files between buckets (keeps original).

Via Web UI

  1. Right-click a file
  2. Select Copy
  3. Choose destination bucket
  4. Confirm

Original file remains in source bucket.

Via API

curl -X POST https://YOUR_DOMAIN/api/files/source-bucket/myfile.pdf/copy \
  -H "Content-Type: application/json" \
  -d '{"destinationBucket": "dest-bucket"}'

Deleting Files

Delete Single File

Via Web UI:

  1. Right-click a file
  2. Select Delete
  3. Confirm deletion

Via API:

curl -X DELETE https://YOUR_DOMAIN/api/files/my-bucket/delete/myfile.pdf

Delete Multiple Files

Via Web UI:

  1. Select multiple files (checkboxes)
  2. Click Delete Selected
  3. Confirm deletion

Via API:

curl -X POST https://YOUR_DOMAIN/api/files/my-bucket/delete-multiple \
  -H "Content-Type: application/json" \
  -d '{"files": ["file1.pdf", "file2.jpg"]}'

Bulk Deletion

For large-scale deletions:

  • Select all files: Click header checkbox
  • Click Delete Selected
  • Confirm deletion of all files

⚠️ Warning: Deletions are permanent and cannot be undone!

File Sorting & Filtering

Sort Options

  • By Name - Alphabetically A-Z
  • By Size - Largest to smallest
  • By Date - Newest to oldest (default)

Search Files

Type in the search box to filter by filename:

  • Real-time filtering
  • Case-insensitive
  • Partial matches supported

Pagination

Large buckets show files in pages:

  • Customize page size (10, 25, 50)
  • Navigate with Next/Previous buttons
  • Jump to specific page

File Details

View File Info

Click a file to see:

  • File name
  • File size (human-readable)
  • Upload date/time
  • Last modified date
  • File type/MIME type

Copy File Details

  • Click file name to copy to clipboard
  • Click size to copy exact bytes
  • Click date to copy ISO format

View Options

Grid View

  • Visual preview (if available)
  • Quick access to actions
  • Better for browsing

Switch to Grid:

  • Click Grid icon in toolbar

List View

  • Detailed file information
  • Sortable columns
  • Better for large buckets

Switch to List:

  • Click List icon in toolbar

Best Practices

Organizing Files

DO:

  • Use folder structure with prefixes: projects/2024/file.pdf
  • Group related files: images/, documents/, videos/
  • Use descriptive names: report-2024-q1.pdf

DON'T:

  • Upload all files to root: file1.pdf, file2.pdf
  • Use unclear names: doc.pdf, IMG001.jpg
  • Mix different file types randomly

Sharing Best Practices

DO:

  • Use signed URLs for secure sharing
  • Set expiration reminders for temporary shares
  • Document what each shared URL provides

DON'T:

  • Share bucket credentials
  • Share direct API URLs with sensitive data
  • Leave old signed URLs active indefinitely

Upload Best Practices

DO:

  • Check file size before uploading
  • Upload during off-peak hours for large files
  • Verify file integrity after upload

DON'T:

  • Interrupt uploads without reason
  • Upload files larger than plan allows
  • Upload sensitive unencrypted data

Troubleshooting

Upload Fails

Problem: Upload stops or fails

Solutions:

  1. Check file size against plan limits
  2. Verify internet connection
  3. Try smaller files first
  4. Check browser console for errors
  5. Try a different browser

Download Takes Too Long

Problem: Download speed is slow

Solutions:

  1. Try downloading during off-peak hours
  2. Check your internet connection
  3. Try downloading smaller files
  4. Check if file is being accessed by others

Can't Find File After Upload

Problem: File uploaded but not visible

Solutions:

  1. Refresh the page
  2. Clear browser cache
  3. Check if file was uploaded to correct bucket
  4. Look for it in list view
  5. Try searching by filename

Move/Copy Fails

Problem: Cannot move or copy file

Solutions:

  1. Verify destination bucket exists
  2. Check you have write permissions
  3. Try copying to same bucket first
  4. Check if file exists in source

API Reference

Complete endpoint documentation available in API Reference:


Next Steps:

R2 Bucket Manager Wiki

Getting Started

Core Features

Development

Security & Authentication

Support & Resources

External Links

Clone this wiki locally