Upload API
واجهة الرفع
Create a key from API keys after you sign in. The full key is shown once and only its SHA-256 hash is stored. Send it as Authorization: Bearer fsk_…
أنشئ المفتاح من صفحة مفاتيح API بعد تسجيل الدخول. يظهر المفتاح الكامل مرة واحدة، ويُحفظ فقط مجموع SHA-256. أرسله في Authorization: Bearer fsk_…
Calls
الطلبات
Replace BASE with your FileShare address. A folder share link lists that folder. A file link downloads that file inside the same folder share.
استبدل BASE بعنوان FileShare. رابط مشاركة المجلد يعرض المجلد. رابط الملف ينزّل ذلك الملف داخل مشاركة المجلد نفسه.
curl -s -X POST "$BASE/api/v1/folders" \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"path":"Client/2026"}'
curl -s "$BASE/api/v1/folders?path=Client/2026" \
-H "Authorization: Bearer $KEY"
curl -s -X POST "$BASE/api/v1/uploads" \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"filename":"photo.jpg","relative_path":"Client/2026/photo.jpg","total_size":12345,"client_key":"0123456789abcdef0123456789abcdef"}'
curl -s -X PUT "$BASE/api/v1/uploads/UPLOAD_ID?index=0&offset=0" \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/octet-stream" \
--data-binary @photo.jpg
curl -s -X POST "$BASE/api/v1/uploads/UPLOAD_ID/complete" \
-H "Authorization: Bearer $KEY"
curl -s -X POST "$BASE/api/v1/shares" \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"path":"Client/2026"}'
curl -s "$BASE/api/v1/usage" -H "Authorization: Bearer $KEY"
curl -s -X DELETE "$BASE/api/v1/files/FILE_ID" -H "Authorization: Bearer $KEY"
curl -s -X DELETE "$BASE/api/v1/folders/FOLDER_ID" -H "Authorization: Bearer $KEY"
curl -s -X DELETE "$BASE/api/v1/shares/SHARE_ID" -H "Authorization: Bearer $KEY"
curl -s -X DELETE "$BASE/api/v1/uploads/UPLOAD_ID" -H "Authorization: Bearer $KEY"
$Headers = @{ Authorization = "Bearer $Key" }
Invoke-RestMethod -Method Post -Uri "$Base/api/v1/folders" -Headers $Headers `
-ContentType "application/json" -Body '{"path":"Client/2026"}'
filename is the file name. relative_path may be the folder, such as Client/2026, or the folder plus that same file name. A last segment that looks like a different file is rejected as ambiguous_path. GET /api/v1/usage needs files:read. DELETE moves a file or folder to trash, revokes a share, or cancels an open upload.
filename هو اسم الملف. relative_path قد يكون المجلد مثل Client/2026 أو المجلد مع اسم الملف نفسه. إذا كان آخر جزء اسم ملف مختلف يُرفض الطلب بـ ambiguous_path. GET /api/v1/usage يحتاج files:read. DELETE ينقل الملف أو المجلد إلى السلة أو يلغي المشاركة أو يلغي رفعًا مفتوحًا.
Usage and delete
الاستخدام والحذف
Usage returns used_bytes, quota_bytes (null when unlimited), unlimited, file_count, and folder_count. Delete is scoped to the key owner and does not purge the file bytes immediately.
الاستخدام يعيد used_bytes وquota_bytes (null عند عدم وجود حد) وunlimited وfile_count وfolder_count. الحذف يخص صاحب المفتاح ولا يمسح بايتات الملف فورًا.
Resume a large folder
استئناف مجلد كبير
The sample scripts walk a local tree, such as tens of gigabytes of photos and videos. The base URL may include /api/v1 or omit it. Repeat --exclude, pass --files with one path per line, and use --min-age to skip a file that is still being written. --idempotent treats a skipped name as success. Run the same command again after a stop. Completed files are skipped. A partial file continues from bytes_received. HTTP 429 means wait for retry_after. An administrator can raise the upload rate or allowlist the address under Settings, Advanced.
السكربتات النموذجية تمسح شجرة محلية، مثل عشرات الجيجابايت من الصور والفيديو. عنوان الأساس قد يتضمن /api/v1 أو بدونه. كرر --exclude، ومرر --files بمسار في كل سطر، واستخدم --min-age لتخطي ملف ما زال يُكتب. --idempotent يعامل الاسم المتخطى كنجاح. أعد الأمر نفسه بعد التوقف. الملفات المكتملة تُتخطى، والملف الناقص يتابع من bytes_received. الرد 429 يعني الانتظار حسب retry_after. يستطيع المدير رفع حد الرفع أو السماح بالعنوان من الإعدادات، متقدم.
The first request from a new PowerShell session can take about 40 seconds, then later requests are fast. That delay is on the client, usually IPv6 or DNS. On that machine set TLS 1.2 and prefer IPv4. The server cannot choose the client address family.
أول طلب من جلسة PowerShell جديدة قد يستغرق نحو 40 ثانية ثم تصبح الطلبات سريعة. التأخير من جهاز العميل، غالبًا IPv6 أو DNS. فعّل TLS 1.2 وفضّل IPv4 على ذلك الجهاز. الخادم لا يختار عائلة عنوان العميل.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 pwsh ./tools/fileshare-upload.ps1 -BaseUrl "https://files.your-domain.com" -Token "fsk_..." -LocalPath "D:\photos" -RemotePath "Archive/2026" -Idempotent curl --ipv4 -sS "https://files.your-domain.com/api/v1/health" ./tools/fileshare-upload.sh --exclude "*.tmp" --min-age 30 --idempotent "https://files.your-domain.com" "fsk_..." "/data/photos" "Archive/2026"