Upload Methods
r2Vault supports three ways to upload files to your R2 bucket:Drag & Drop
Drop files from Finder directly into the browser window
File Picker
Click the + button and choose Upload Files…
Menu Bar Widget
Drop files into the menu bar drop zone for instant upload
Drag-and-Drop from Finder
The fastest way to upload files:Drag to r2Vault
Drop them anywhere in the browser window. A blue overlay appears when the drop zone is active.
Files are uploaded to the current folder shown in the breadcrumb path. Navigate to a folder first to upload files there.
Folder Uploads
Dragging a folder recursively enumerates all files and preserves the folder structure:AppViewModel.swift:360-420 (source: Fiaxe/ViewModels/AppViewModel.swift:360-420)
Upload Files Button
Use the toolbar button for more control:
Implementation:
AppViewModel.swift:458-469 (source: Fiaxe/ViewModels/AppViewModel.swift:458-469)
Concurrent Uploads with Progress
Uploads run in parallel for maximum speed:Queue Behavior
- Up to multiple files upload simultaneously
- Each upload has its own progress bar
- Queue updates in real-time as files complete
- Failed uploads stay in the queue for review
Progress Display
- Main Window
The browser refreshes automatically when uploads complete, showing newly added files.
MenuBarView.swift:188-221 (source: Fiaxe/Views/MenuBarView.swift:188-221)
Upload Lifecycle
| Status | Description |
|---|---|
| Pending | Queued, waiting for an available slot |
| Uploading | Active transfer with live progress |
| Completed | Successfully uploaded to R2 |
| Failed | HTTP error or network issue |
| Cancelled | User cancelled via Cancel button |
UploadTask.swift:23-29 (source: Fiaxe/Models/UploadTask.swift:23-29)
Canceling Uploads
Stop uploads in progress:Cancel individual files
Cancel individual files
From the menu bar widget, click the × button next to any uploading file.
Cancel all uploads
Cancel all uploads
Click Cancel All in the menu bar upload progress section.
UploadTask.swift:41-45 (source: Fiaxe/Models/UploadTask.swift:41-45)
Auto-Copy Public URL to Clipboard
When an upload completes successfully:URL generated
r2Vault constructs the public URL:
- Uses custom domain if configured
- Falls back to R2 endpoint:
https://<account>.r2.cloudflarestorage.com/<bucket>/<key>
No extra clicks needed — paste the URL immediately into your browser, Slack, or anywhere else!
AppViewModel.swift:559-578 (source: Fiaxe/ViewModels/AppViewModel.swift:559-578)
Custom Domain URLs
If you’ve configured a custom domain in Settings:- Clipboard auto-copy
- Upload history
- “Copy URL” context menu action
R2Credentials.swift:36-45 (source: Fiaxe/Models/R2Credentials.swift:36-45)
Upload Service Details
Uploads use the S3-compatible PUT API with AWS Signature Version 4:Request Details
Request Details
- Method:
PUT - Endpoint:
https://<account>.r2.cloudflarestorage.com/<bucket>/<key> - Headers:
Content-Type: MIME type (auto-detected from file extension)Content-Length: File size in bytesAuthorization: AWS4-HMAC-SHA256 signature
Progress Tracking
Progress Tracking
Uses Progress is calculated as
URLSessionTaskDelegate to receive real-time byte counts:totalBytesSent / totalBytesExpectedToSend.Error Handling
Error Handling
Uploads fail if:
- HTTP status code is not
2xx - Network connection is lost
- Task is cancelled by user
- File permissions prevent reading
R2UploadService.swift:19-50 (source: Fiaxe/Services/R2UploadService.swift:19-50)