bkend-storage
Skill70 starsChanged 9 months agoApache-2.0View on GitHub
bkend.ai file storage guide. File upload, download, presigned URLs, bucket management, and CDN integration with bkend.ai BaaS. Triggers: bkend storage, file upload, file download, presigned URL, bucket, CDN, bkend 스토리지, 파일 업로드, 파일 다운로드, bkendストレージ, ファイルアップロード, bkend存储, 文件上传, almacenamiento bkend, stockage bkend, bkend-Speicher Do NOT use for: auth (use $bkend-auth), data operations (use $bkend-data).
- Sends data out
2 other projects use a version of this.
Adopted by
Most recently taken up by
- ww-w-ai/bkit-claude-codetheir own version, first seen Aug 14, 2026
- ww-w-ai/bkit-geminitheir own version, first seen Apr 9, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- ww-w-ai/bkit-claude-code★ 600same name
- ww-w-ai/bkit-gemini★ 66same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository27 other files it gives its agents.
- AGENTS.mdAGENTS.md
- bkend-authSkill
- bkend-cookbookSkill
- bkend-dataSkill
- bkend-quickstartSkill
- bkit-rulesSkill
- bkit-templatesSkill
- code-reviewSkill
- codex-learningSkill
- desktop-appSkill
- development-pipelineSkill
- dynamicSkill
- enterpriseSkill
- mobile-appSkill
- pdcaSkill
- phase-1-schemaSkill
- phase-2-conventionSkill
- phase-3-mockupSkill
- phase-4-apiSkill
- phase-5-design-systemSkill
- phase-6-ui-integrationSkill
- phase-7-seo-securitySkill
- phase-8-reviewSkill
- phase-9-deploymentSkill
- plan-plusSkill
- starterSkill
- zero-script-qaSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 175
Use appropriate buckets (images, documents, attachments)
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
bkend.ai File Storage
Upload, download, and manage files with bkend.ai storage.
Actions
| Action | Description | Example |
setup | Configure storage | $bkend-storage setup |
upload | Upload file guide | $bkend-storage upload |
cdn | CDN configuration | $bkend-storage cdn |
File Upload
Basic Upload
async function uploadFile(file: File, bucket: string = 'default') {
const formData = new FormData();
formData.append('file', file);
formData.append('bucket', bucket);
const token = localStorage.getItem('bkend_access_token');
const res = await fetch(`${API_BASE}/storage/upload`, {
method: 'POST',
headers: {
'x-project-id': PROJECT_ID,
...(token && { Authorization: `Bearer ${token}` }),
// Do NOT set Content-Type for FormData
},
body: formData,
});
if (!res.ok) throw new Error(await res.text());
return res.json(); // { url, key, size, contentType }
}Upload with Validation
const ALLOWED_TYPES = ['image/jpeg', 'image/png', 'image/webp', 'application/pdf'];
const MAX_SIZE = 10 * 1024 * 1024; // 10MB
function validateFile(file: File): string | null {
if (!ALLOWED_TYPES.includes(file.type)) return 'File type not allowed';
if (file.size > MAX_SIZE) return 'File too large (max 10MB)';
return null;
}Image Upload Component
'use client';
import { useState, ChangeEvent } from 'react';
interface ImageUploadProps {
onUpload: (url: string) => void;
maxSize?: number; // bytes
accept?: string;
}
export function ImageUpload({ onUpload, maxSize = 5 * 1024 * 1024, accept = 'image/*' }: ImageUploadProps) {
const [uploading, setUploading] = useState(false);
const [preview, setPreview] = useState<string | null>(null);
const handleChange = async (e: ChangeEvent<HTMLInputElement>) => {
const file = e.target.files?.[0];
if (!file) return;
if (file.size > maxSize) {
alert(`File must be under ${Math.round(maxSize / 1024 / 1024)}MB`);
return;
}
// Show preview
setPreview(URL.createObjectURL(file));
setUploading(true);
try {
const { url } = await bkend.storage.upload(file, 'images');
onUpload(url);
} catch {
alert('Upload failed');
setPreview(null);
} finally {
setUploading(false);
}
};
return (
<div className="space-y-2">
<label className="block cursor-pointer">
<input type="file" accept={accept} onChange={handleChange} className="hidden" />
<div className="border-2 border-dashed rounded-lg p-6 text-center hover:border-blue-400">
{preview ? (
<img src={preview} alt="Preview" className="mx-auto max-h-48 rounded" />
) : (
<p className="text-gray-500">{uploading ? 'Uploading...' : 'Click to upload'}</p>
)}
</div>
</label>
</div>
);
}File Download
Get Presigned URL
const { url } = await bkend.storage.getUrl(fileKey);
window.open(url, '_blank');Download with Fetch
async function downloadFile(key: string, filename: string) {
const { url } = await bkend.storage.getUrl(key);
const res = await fetch(url);
const blob = await res.blob();
const a = document.createElement('a');
a.href = URL.createObjectURL(blob);
a.download = filename;
a.click();
URL.revokeObjectURL(a.href);
}Bucket Management
// List files in bucket
const files = await bkend.storage.list('images');
// Delete file
await bkend.storage.delete(fileKey);CDN Configuration
bkend.ai serves files through CDN automatically:
- Files are cached at edge locations globally
- URLs include cache-busting via file key
- Images can be transformed via URL parameters
// Original
https://cdn.bkend.ai/project-id/images/photo.jpg
// Resized
https://cdn.bkend.ai/project-id/images/photo.jpg?w=300&h=200
// Format conversion
https://cdn.bkend.ai/project-id/images/photo.jpg?format=webpBest Practices
- Validate file type and size before upload
- Use appropriate buckets (images, documents, attachments)
- Show upload progress for large files
- Generate thumbnails for image-heavy apps
- Clean up unused files periodically
Reference
See references/bkend-patterns.md for complete storage API patterns.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

