# Namespace: content

## QB. content

Content

### Methods

#### private,staticQB.content.create(params, callback)

modules/qbContent.js, line 69
  Create new file object.

  Name | Type | Description
  --- | --- | ---
  `params` | object | Object of parameters.
  Name | Type | Default | Description
  --- | --- | --- | ---
  `content_type` | string |  | The file's mime(content type).
  `name` | string |  | The file's name.
  `public` | boolean | false | optional The file's visibility. public means it will be possible to access this file without QuickBlox session token provided. Default is 'false'.
  `callback` | createFileCallback | The createFileCallback function.

#### staticQB.content.createAndUpload(params, callback)

modules/qbContent.js, line 122
  Create file > upload file > mark file as uploaded > return result(read more).

  Name | Type | Description
  --- | --- | ---
  `params` | object | Object of parameters.
  Name | Type | Default | Description
  --- | --- | --- | ---
  `file` | object |  | File object.
  `name` | string |  | The file's name.
  `type` | string |  | The file's mime (content type).
  `size` | number |  | Size of file, in bytes.
  `public` | boolean | false | optional The file's visibility. public means it will be possible to access this file without QuickBlox session token provided. Default is 'false'.
  `callback` | createAndUploadFileCallback | The createAndUploadFileCallback function.

#### staticQB.content.delete(id, callback)

modules/qbContent.js, line 95
  Delete file by id(read more).

  Name | Type | Description
  --- | --- | ---
  `id` | Number | blob_id.
  `callback` | deleteFileCallback | The deleteFileCallback function.

#### staticQB.content.getFile(uid, callback)

modules/qbContent.js, line 292
  Download file by UID. If the file is public then it's possible to download it without a session token(read more).

  Name | Type | Description
  --- | --- | ---
  `uid` | String | File object uid.
  `callback` | downloadFileByUIDCallback | The downloadFileByUIDCallback function.

#### staticQB.content.getInfo(id, callback)

modules/qbContent.js, line 270
  Retrieve file object info by id(read more).

  Name | Type | Description
  --- | --- | ---
  `id` | number | File object id.
  `callback` | getFileInfoByIdCallback | The getFileInfoByIdCallback function return file's object.

#### staticQB.content.list(params, callback)

modules/qbContent.js, line 38
  Get a list of files for current user(read more).

  Name | Type | Description
  --- | --- | ---
  `params` | object | Object of parameters.
  Name | Type | Default | Description
  --- | --- | --- | ---
  `page` | number | 1 | optional Used to paginate the results when more than one page of files retrieved.
  `per_page` | number | 10 | optional The maximum number of files to return per page, if not specified then the default is 10.
  `callback` | listOfFilesCallback | The listOfFilesCallback function.

#### private,staticQB.content.markUploaded(params, callback)

modules/qbContent.js, line 241
  Declare file uploaded. The file's 'status' field will be set to 'complete'.

  Name | Type | Description
  --- | --- | ---
  `params` | object | Object of parameters.
  Name | Type | Description
  --- | --- | ---
  `blob_id` | number | The id of file to declare as uploaded.
  `size` | number | Size of file, in bytes.
  `callback` | markUploadedFileCallback | The markUploadedFileCallback function.

#### staticQB.content.privateUrl(fileUID)

modules/qbContent.js, line 345
  Get private URL for file download by file_uid (blob_uid) (read more).

  Name | Type | Description
  --- | --- | ---
  `fileUID` | String | File object id.

#### staticQB.content.publicUrl(fileUID)

modules/qbContent.js, line 354
  Get public URL for file download by file_uid (blob_uid) (read more).

  Name | Type | Description
  --- | --- | ---
  `fileUID` | String | File object id.

#### staticQB.content.update(params, callback)

modules/qbContent.js, line 316
  Edit a file by ID(read more).

  Name | Type | Description
  --- | --- | ---
  `params` | object | Object of parameters.
  Name | Type | Description
  --- | --- | ---
  `id` | number | File object id.
  `name` | string | optional New file name.
  `callback` | updateFileCallback | The updateFileCallback function.

#### private,staticQB.content.upload(params, callback)

modules/qbContent.js, line 208
  Upload a file to cloud storage.

  Name | Type | Description
  --- | --- | ---
  `params` | Object | Object of parameters (see into source code of QB.content.createAndUpload(params, callback) to know how to prepare the params object).
  Name | Type | Description
  --- | --- | ---
  `url` | string | File url.
  `data` | object | Formed data with file.
  `callback` | uploadFileCallback | The uploadFileCallback function.