media.createMultiPartUpload
Syntax
ARRAY/ media.createMultiPartUpload (
INT vhost,
STRING filename,
STRING contentType,
ARRAY partInfo,
ARRAY fileData = array(),
INT timeOut = 6000,
mixed setAvatar = false,
mixed checksums = array() )
Argument Info
Name | Type | Required | Default value | Description |
---|
vhost | INT | Required | none | The vhost ID. |
filename | STRING | Required | none | Original filename of the file being uploaded, including the extension. |
contentType | STRING | Required | none | The content type of the file being uploaded eg. image/jpeg |
partInfo | ARRAY | Required | none | An array containing the chunk number as the index, and the chunk filesize in bytes as the value. eg partInfo[1]=5242880 |
fileData | ARRAY | Optional | array() | An array containing additional information about the file, such as title, message, metadata. |
timeOut | INT | Optional | 6000 | The amount of time in minutes eac/arh signed URL will be valid for, after this time limit the URL will no longer work. |
setAvatar | mixed | Optional | false | |
checksums | mixed | Optional | array() | |
Response
A reason for failure will be returned otherwise you'll receive an ID representing the media, and a partUrls array.
Name | Type | Description | Default Values |
---|
id | INT | Will contain the media ID of the new upload, this should be used throughout the upload process | media id |
partUrls | ARRAY | A list containing 'url' and 'part', for each part provided in the partInfo array, part being the index number of a certain chunk. | [url]/[part] |
status | BOOL | Will return false, if there is a failure, otherwise true. | boolean |
cause | STRING | Will only return in the event of a failure with the reason. | string |
fileData Array
The fileData array may contain the following parameters.
Name | Type | Description | Default Values |
---|
title | STRING | The title of the media item being uploaded.. | none |
message | STRING | The description of the media item being uploaded. | none |
meta | ARRAY | Use this to include additional custom information about the file when uploaded. | none |
uid | INT | The ID of the user who is uploading the media. | If not provided it will default to anonymous user(1) |
channel | INT | The channel ID of the media item is going to be uploaded into. | none |
parentid | INT | The media id that you'd like to be the parent of this media. | none |
tags | STRING | A set of words used to tag the media item. Tags are searchable in our system. Each tag is separated by a space — for example "upload media torontoweather toronto". | none |
Return Values
Field | Description | Possible Values |
---|