Reset Password
Check your e-mail for further instructions.
Reset
Name
savethumb
Auth
yes
Description
Create a thumbnail of a file and save it in the current user's filesystem
takes the same parameters as getthumblink in addition to topath or tofolderid+toname and save the generated thumbnail as a file.
As usual by default this call overwrites existing files (saving the old one as revision) unless the noover parameter is set. In that case 'File or folder alredy exists.' error will be generated.
If toname is not provided, but tofolderid is, the file's original name is used for the thumbnail.
Similarly if topath ends with a slash ('/'), the original filename is appended.
URL
https://api.pcloud.com/savethumb
Required
Parameter | Description |
fileid | int id of the file for thumb |
path | string filepath to the file for thumb |
size | string WIDTHxHEIGHT |
topath | string filepath where to save the thumb |
tofolderid | int folder id of the folder where to save the thumb |
toname | string filename to save the thumb |
Optional
Parameter | Description |
crop | int If set, then the thumb will be cropped |
type | string If set to png, then the thumb will be in png format |
noover | int If set, then will rise error on overwriting |
Output
On success returns metadata, width and height.
Example
{ result: 0, height: 32, width: 32, metadata: { path: "/my%20thumb.jpg", thumb: true, modified: "Thu, 03 Oct 2013 15:30:43 +0000", parentfolderid: 0, created: "Thu, 03 Oct 2013 15:30:43 +0000", ismine: true, category: 1, hash: 1154152318038973000, isshared: false, contenttype: "image/jpeg", fileid: 1818093, size: 650, id: "f1818093", icon: "image", name: "my thumb.jpg", isfolder: false } }
Code | Description |
1000 | Log in required. |
1004 | No fileid or path provided. |
1014 | Thumb can not be created from this file type. |
1015 | Please provide valid thumb size. Width and height must be divisible either by 4 or 5 and must be between 16 and 2048 (1024 for height). |
1016 | No full topath or toname/tofolderid provided. |
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. |
3001 | Could not create thumb from the given file. |
4000 | Too many login tries from this IP address. |
5000 | Internal error. Try again later. |