API 參考
建立大型檔案上傳工作階段
為不超過 5 GB 的檔案建立 TUS 上傳工作階段;若檔案雜湊符合既有檔案,則無需重複上傳。
POST
Upload session parameters
application/json- body
alias?stringCustom slug for the short link (optional, alphanumeric only)
Length
length <= 255description?stringDescription (optional)
Length
length <= 1024domain?stringDomain for short link (optional, use /api/v1/file/domains to list)
Length
length <= 255expire_at?integerUnix timestamp for link expiry (optional)
file_hash?stringSHA256 hash for instant upload deduplication (optional)
Length
length <= 255file_name*stringOriginal filename (required)
Length
length <= 255file_size*integerFile size in bytes (required)
is_private?integerPrivacy: 0=public (default), 1=private
Value in
01mime_type?stringMIME type hint (optional, server will detect from file bytes)
Length
length <= 255password?stringAccess password (3–32 chars, optional)
Length
3 <= length <= 32replace_file_id?integerID of an existing file whose content should be replaced by this upload (optional). The short link and the file URL stay unchanged; title, domain, alias, password and is_private are ignored.
title?stringTitle for the file (optional)
Length
length <= 255OK
application/json- response
code?integerdata?message?stringcurl -X POST 'https://s.ee/api/v1/file/large-file/create' \ -H 'Authorization: string' \ -H 'Content-Type: application/json' \ -d '{ "file_name": "string", "file_size": 0}'Example Response200
{ "code": 0, "data": { "existing_file": { "created_at": 0, "delete": "string", "file_id": 0, "filename": "string", "hash": "string", "height": 0, "mime_type": "string", "page": "string", "path": "string", "size": 0, "storename": "string", "thumb_url": "string", "upload_status": 0, "url": "string", "width": 0 }, "expires_at": 0, "fast_upload": true, "file_size": 0, "id": 0, "upload_id": "string", "upload_url": "string" }, "message": "string"}