SysUploadStream
Upload a global file directly.
| Service | Operation |
|---|---|
| globalFileV3 | SYS_UPLOAD_STREAM |
Method Parameters
| Parameter | Description |
|---|---|
| treeId | The id of the folder (optional). Default is the root folder. |
| filename | The destination file name. |
| overwriteIfPresent | Whether to allow overwrite of an existing file if present (optional). Default is false. |
| fileData | Base64 encoded file contents. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
var treeId = "xxxx-yyyy-zzzz";
var filename = "myglobalfile.json";
var overwriteIfPresent = True;
var fileData = "alsjfalfjaeiojefjkjbjldjflekf";
var globalFileV3Proxy = bridge.getGlobalfilev3ServiceProxy();
var postResult = globalFileV3Proxy.sysUploadStream(treeId, filename, overwriteIfPresent, fileData);
{
"service":"globalFileV3",
"operation":"SYS_UPLOAD_STREAM",
"data":{
"treeId":"xxxx-yyyy-zzzz",
"filename":"myglobalfile.json",
"overwriteIfPresent":true,
"fileData":"alsjfalfjaeiojefjkjbjldjflekf"
}
}
JSON Response
{
"fileDetails": {
"contentMd5": "\"83252e036cd096de9198039e3d19a121\"",
"treeId": "b6fb0efe-2d15-4a25-b43b-72684d7c788f",
"fileName": "cloudfilename.txt",
"fileSize": 36,
"dateUploaded": 1768152547000,
"etag": "\"83252e036cd096de9198039e3d19a121\"",
"version": 1,
"url": "https://api.braincloudservers.com/files/bc/g/23782/f/b6fb0efe-2d15-4a25-b43b-72684d7c788f/559a430c-078e-4107-9e37-2a74ba2c2fa5/V1/cloudfilename.txt",
"fileId": "559a430c-078e-4107-9e37-2a74ba2c2fa5"
}
}