Name
downloadfileasync
Auth
yes
Description
Download a file/s
Downloads one or more files from links suplied in the url parameter (links separated by any amount of whitespace) to the folder identified by either path or folderid (or to the root folder if both are omitted). The response will be recieved when the files are queued for download, not when they are downloaded. The parameter string progresshash can be passed. The same should be passed to uploadprogress method. When monitoring progress with uploadprogress the following fields will be present:
Field | Description |
urlcount | int number of URLs requested |
urlready | int number of URLs already downloaded |
urlworking | int number of currently downloading URLs |
finished | bool true if all URLs are downloaded |
files | array of objects |
Field | Description |
url | string the url |
status | string One of:
|
size | int available only for started downloads only when the server supplied Content-Length - the size of the file |
downloaded | int available only for started downloads - number of bytes downloaded so far (goes up to size) |
metadata | metadata available only for ready downloads - the metadata of the file in the user's filesystem |
URL
https://api.pcloud.com/downloadfileasync
Required
Parameter | Description |
url | string links separated by any amount of whitespace |
Optional
Parameter | Description |
path | string path to folder, in which to download the files |
folderid | string folderid of the folder, in which to download the files |
target | string desired names for the downloaded files |
Output
The method returns when all files are downloaded (which might take time). On success metadata array with metadata of all downloaded files is returned.
Example
{ "result": 0, "metadata": [ { "icon": "image", "path": "\Simple image.jpg", "isshared": false, "ismine": true, "fileid": 1736716, "size": 15604, "category": 1, "name": "Simple image.jpg", "created": "Wed, 02 Oct 2013 15:57:13 +0000", "hash": 6306013028049022731, "parentfolderid": 0, "modified": "Wed, 02 Oct 2013 15:57:28 +0000", "thumb": true, "isfolder": false, "height": 300, "width": 222, "id": "f1736716", "contenttype": "image\/jpeg" } ] }
Code | Description |
1000 | Log in required. |
1040 | Please provide 'url'. |
2000 | Log in failed. |
2003 | Access denied. You do not have permissions to preform this operation. |
2005 | Directory does not exist. |
2008 | User is over quota. |
4000 | Too many login tries from this IP address. |
5000 | Internal error. Try again later. |
5001 | Internal upload error. |