RegisterFileUploadCallback
Registers the file upload callbacks.
Method Parameters
| Parameter | Description |
|---|---|
| fileUploadCallback | The file upload callback handler. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
_bc.RegisterFileUploadCallbacks(successCallback, failureCallback);
_bc->registerFileUploadCallback(this);
fileUploadCompletedBlock = ^(NSString *fileUploadId, NSString *jsonResponse) { };
fileUploadFailedBlock = ^(NSString *fileUploadId, NSInteger status, NSInteger reasonCode, NSString *jsonResponse) { };
[_bc registerFileUploadCallback:fileUploadCompletedBlock failedBlock:fileUploadFailedBlock];
_bc.registerFileUploadCallback(callback);
// N/A
void fileCallback(ServerResponse response) {
if (response.status == 200) {
// ...
}
};
_bc.registerFileUploadCallback(fileCallback);
// N/A
// N/A
JSON Response
// SUCCESS JSON
{
"status": 200,
"data": {
"fileDetails": {
"updatedAt": 1452616408147,
"fileSize": 100,
"expiresAt": 1452702808146,
"shareable": true,
"createdAt": 1452616408147,
"profileId": "bf8a1433-62d2-448e-b396-f3dbffff44",
"gameId": "99999",
"cloudFilename": "filename",
"cloudLocation": "bc/g/99999/u/bf8a1433-62d2-448e-b396-f3dbffff44/f/dir1/dir2/filename",
"downloadUrl": "https://api.braincloudservers.com/downloader/bc/g/99999/u/bf8a1433-62d2-448e-b396-f3dbffff44/f/dir1/dir2/filename",
"cloudPath": "dir1/dir2",
}
}
}
// FAILURE JSON
{
"status": 403,
"reason_code": 40300,
"status_message": "Message describing failure",
"severity": "ERROR"
}