// In the browser: no SDK, no API keyconst picked = document.querySelector('input[type=file]').files[0];
// 1. Ask your own server for an upload URLconst { upload } = awaitfetch('/api/upload', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ name: picked.name, size: picked.size, type: picked.type }),
}).then((r) => r.json());
// 2. Send the bytes straight to Rapidfile (files up to 95 MB use one PUT)const res = awaitfetch(upload.url, { method: 'PUT', body: picked });
const { file } = await res.json();
console.log(file.url); // https://cdn.rapidfile.cc/<id>/<name>
terminal
# 1. Create an upload (server side, with your secret key)curl https://api.rapidfile.cc/v1/uploads \
-H"Authorization: Bearer $RAPIDFILE_SECRET_KEY" \
-H"Content-Type: application/json" \
-d'{"name":"cat.jpg","size":48213,"type":"image/jpeg"}'# 2. PUT the bytes to upload.url from the response (no key needed)curl-T cat.jpg "$UPLOAD_URL"# Or upload from your server in one request (up to 95 MB)curl-T cat.jpg -H"Content-Type: image/jpeg" \
-H"Authorization: Bearer $RAPIDFILE_SECRET_KEY" \
"https://api.rapidfile.cc/v1/files?name=cat.jpg"
হয়। "acl": "private"ৰে আপলোড সৃষ্টি কৰক। ব্যক্তিগত ফাইলৰ কোনো সৰ্বজনীন URL নাথাকে; কোনো ব্যৱহাৰকাৰীয়ে ফাইলটো চাব লাগিলে আপোনাৰ চাৰ্ভাৰে স্বল্পমেয়াদী চাইন কৰা URL (7 দিনলৈ) সৃষ্টি কৰে।