Files.createUpload.call(bulkRequestOf(FilesCreateUploadRequestItem( conflictPolicy = WriteConflictPolicy.REJECT, id ="/123/folder", supportedProtocols =listOf(UploadProtocol.CHUNKED), )), user).orThrow()/*BulkResponse( responses = listOf(FilesCreateUploadResponseItem( endpoint = "https://provider.example.com/ucloud/example-provider/chunked", protocol = UploadProtocol.CHUNKED, token = "f1460d47e583653f7723204e5ff3f50bad91a658", )), )*//* The user can now proceed to upload using the chunked protocol at the provided endpoint */
Communication Flow: Curl
# ------------------------------------------------------------------------------------------------------# $host is the UCloud instance to contact. Example: 'http://localhost:8080' or 'https://cloud.sdu.dk'# $accessToken is a valid access-token issued by UCloud# ------------------------------------------------------------------------------------------------------# Authenticated as usercurl -XPOST -H "Authorization: Bearer $accessToken" -H "Content-Type: content-type: application/json; charset=utf-8" "$host/api/files/upload" -d '{
"items": [ {"id":"/123/folder","supportedProtocols": ["CHUNKED" ],"conflictPolicy":"REJECT" } ]}'# {# "responses": [# {# "endpoint": "https://provider.example.com/ucloud/example-provider/chunked",# "protocol": "CHUNKED",# "token": "f1460d47e583653f7723204e5ff3f50bad91a658"# }# ]# }# The user can now proceed to upload using the chunked protocol at the provided endpoint