Before you begin
- Register a QuickBlox account. This is a matter of a few minutes and you will be able to use this account to build your apps.
- Configure QuickBlox SDK for your app. Check out Setup page for more details.
- Create a user session to be able to use QuickBlox functionality. See Authentication page to learn how to do it.
Retrieve files
Get a list of files for a current user using the code snippet below.- Swift
- Objective-C
Upload file
Upload a file to the cloud using the following code snippet.- Swift
- Objective-C
| Basic | Startup | Growth | HIPAA | Enterprise | |
|---|---|---|---|---|---|
| File size limit | 10 Mb | 25 Mb | 50Mb | 50Mb | Contact our sales team | 
Update file
Update a previously uploaded file in the cloud using thetUpdateFile(with:file:) method below. Set the isNew field as true if you want to update a file.
- Swift
- Objective-C
| Argument | Required | Description | 
|---|---|---|
| newImageData | Yes | A new file in NSData format. | 
| existingBlob | Yes | A previously obtained blob witha file that needs to be updated. | 
Download file by UID
If the file is public then it’s possible to download it without a session token.- Swift
- Objective-C
Get file info
Get information about a file by ID using the method below. This method allows to load the file description model from the server, not the content of the file itself.- Swift
- Objective-C
| Argument | Required | Description | 
|---|---|---|
| fileId | yes | ID of the file/blob. | 
| successBlock | yes | Specifies a response block that is called if the request is succeeded. As a result, the response will contain a blob/file description model. | 
| errorBlock | yes | Specifies a response block that is called in case an error is occurred. | 
Get file URL
There are two types of file URLs that can be obtained: private and public.- Public URL allows anyone to access the file, no authorization token is needed.
- Private URL can be accessed only by QuickBlox user with a session token.
Get public URL
To receive a public URL, use the code snippet below.- Swift
- Objective-C
| Argument | Required | Description | 
|---|---|---|
| fileUID | yes | File unique identifier. Type String | 
Get private URL
To get a private URL of the uploaded file, use the following code snippet.- Swift
- Objective-C
| Argument | Required | Description | 
|---|---|---|
| fileUID | yes | File unique identifier. Type String | 
Delete file
Delete a file by file ID using thedeleteBlob() method.
- Swift
- Objective-C
| Argument | Required | Description | 
|---|---|---|
| fileId | yes | ID of the file/blob. | 
| successBlock | yes | Specifies a response block that is called if the request is succeeded. | 
| errorBlock | yes | Specifies a response block that is called in case an error is occurred. |