file-uploads
Expert at handling file uploads and cloud storage. Covers S3, Cloudflare R2, presigned URLs, multipart uploads, and image optimization. Knows how to handle large files without blocking. Use when: file upload, S3, R2, presigned URL, multipart.
Author
Category
File ManagementInstall
Hot:12
Download and extract to your skills directory
Copy command and send to OpenClaw for auto-install:
Download and install this skill https://openskills.cc/api/download?slug=sickn33-skills-file-uploads&locale=en&source=copy
File Uploads - File Uploading and Cloud Storage Expert
Skill Overview
File Uploads is an AI skill focused on secure, efficient file uploads and cloud storage integration. It helps developers handle everything from simple image uploads to complex large-file chunked uploads.
Use Cases
1. Direct Upload to Cloud Storage
Send user-uploaded files directly to cloud storage services like S3 or Cloudflare R2, avoiding server relaying. This is especially suitable for large files, videos, or high-concurrency upload scenarios, reducing server bandwidth usage and memory consumption.
2. Large Files and Chunked Uploads
Supports uploading GB-scale files with chunking, resumable uploads, and progress tracking. It avoids request timeouts or excessive server resource usage from single large requests, improving upload reliability and user experience.
3. Secure File Type Validation
Strictly verify the true type of user-uploaded files to prevent malicious files disguised as other formats. Detect file types by checking Magic Bytes instead of file extensions, and sanitize filenames to prevent path traversal attacks.
Core Features
S3 & R2 Pre-signed URLs
Generate time-limited authorized upload URLs so the client can upload directly to cloud storage without exposing server credentials. Supports custom expiration times and permission controls, reducing server proxy overhead and security risks.
Chunked Uploads and Resumable Uploads
Split large files into multiple smaller chunks for parallel uploading. Supports retrying failures and resuming from where uploads stopped. Ideal for unstable network environments or ultra-large file scenarios, significantly improving upload success rates.
Image Optimization
Automatically compress and optimize images during upload or storage to reduce storage costs and load times. Supports format conversion, resizing, and quality optimization, suitable for avatars, albums, and similar use cases.
Common Questions
Why shouldn’t you trust the file extension provided by the client?
File extensions can be changed arbitrarily. Malicious users can rename an executable file to .jpg or .png to bypass checks. The correct approach is to identify the real file type by reading the file header (Magic Bytes). For example, JPEG files always start with
FF D8 FF.What’s the difference between pre-signed URLs and server-proxy uploads?
A pre-signed URL is a temporary authorized link generated by the cloud storage service. The client can upload directly without going through your server. With server proxy uploads, the client uploads the file to your server first, and then your server forwards it to cloud storage. Pre-signed URLs save server resources and bandwidth and are more secure because the file never passes through your server.
Will large file uploads block the server?
With a traditional server-proxy approach, large files do occupy server memory and connections. The correct approach is to use pre-signed URLs for direct client uploads to cloud storage, or use chunked upload techniques. If uploads must go through the server, use streaming rather than caching the entire file in memory.