Reset Password
Check your e-mail for further instructions.
Reset
Name
copypubfile
Auth
yes
Description
Copies the file from the public link to the current user's filesystem
Expects as parameter code that can be either 'code' or 'shortcode'.
The code could be obtained from:
Consequently copypubfile can be performed even if the public link has run out of downloads or traffic quota.
Implementations are advised to advertise this function when getpublinkdownload returns an error code identifying out of downloads or out of traffic condition. Unauthenticated users, of course, will have to first register/log in in this case.URL
https://api.pcloud.com/copypubfile
Required
Parameter | Description |
code | string either 'code' or 'shortcode' |
fileid | int File id, if the link is to a folder |
path | string path to the target file |
tofolderid | int id of destination folder |
topath | string destination path |
Optional
Parameter | Description |
toname | string name of the destination file. If omitted, then the original filename is used |
noover | int If it is set and file with the specified name already exists, no overwriting will be preformed |
Output
When successful, copies the file from the public link to the current user's account and returns the new file's metadata.
Example
{ "result": 0, "metadata": { "category": 1, "width": 900, "thumb": true, "created": "Wed, 02 Oct 2013 15:05:17 +0000", "hash": 10681749967730527559, "icon": "image", "ismine": true, "name": "Simple image.jpg", "modified": "Wed, 02 Oct 2013 15:05:17 +0000", "isfolder": false, "contenttype": "image\/jpeg", "fileid": 1732283, "isshared": false, "id": "f1732283", "size": 73269, "parentfolderid": 28110, "height": 600 } }
Code | Description |
1000 | Log in required. |
1004 | No fileid or path provided. |
1016 | No full topath or toname/tofolderid provided. |
1028 | Please provide link 'code'. |
1029 | Please provide 'fileid'. |
2000 | Log in failed. |
2001 | Invalid file/folder name. |
2002 | A component of parent directory does not exist. |
2003 | Access denied. You do not have permissions to preform this operation. |
2004 | File or folder alredy exists. |
2008 | User is over quota. |
2009 | File not found. |
2010 | Invalid path. |
4000 | Too many login tries from this IP address. |
5000 | Internal error. Try again later. |
7001 | Invalid link 'code'. |
7002 | This link is deleted by the owner. |
7004 | This link has expired. |
7005 | This link has reached its traffic limit. |
7006 | This link has reached maximum downloads. |