Skip to main content
Version: 6.0.0

SysPrepareUpload

Prepare for the uploading of a global file.

ServiceOperation
globalFileV3SYS_PREPARE_UPLOAD

Method Parameters

ParameterDescription
treeIdThe id of the folder (optional). Defaults to root folder.
filenameThe destination file name.
fileSizeFile size (in bytes) to be uploaded.
overwriteIfPresentWhether to allow overwrite of an existing file if present (optional). Defaults to false.
tip

Using these results (specifically the uploadUrl value from the repspnse of SysPrepareUpload), to finally upload the file. The following template can be used to upload the file

curl -X POST "https://api.braincloudservers.com/s2suploader/globalfile/upload?gameId=23782&uploadId=6b24c759-6c9f-44b7-a8d5-a493f3d4b6cb&filename=testfile.txt&overwriteIfPresent=true&fileSize=352" -F "file=@testfile.txt"

Usage

http://localhost:3000
// S2S call: to view example, switch to the Cloud Code or Raw tab.
JSON Response
{
"fileDetails": {
"gameId": "23782",
"shareable": false,
"uploadId": "4848d54f-c8f9-4c7e-9ab4-8c68c040cf95",
"replaceIfExists": true,
"cloudPath": "_root_",
"expiresAt": 1768671291708,
"createdAt": 1768066491708,
"uploadUrl": "/s2suploader/globalfile/upload?gameId=23782&uploadId=4848d54f-c8f9-4c7e-9ab4-8c68c040cf95&filename=before.json&overwriteIfPresent=true&fileSize=352",
"fileSize": 352,
"profileId": "_S2S_",
"localPath": null,
"cloudFilename": "before.json",
"fileType": "Global",
"updatedAt": 1768066491708
}
}