• General
  • My Apps
  • SDKs
  • Protocols
  • Structures
  • Methods
  • Errors
Log in Register Log out
  • General

  • My Apps

  • SDKs
    • C
    • Java
    • Javascript
    • Php
    • Swift

  • Protocols
    • HTTP JSON Protocol
      • Authentication
      • Single Connection
      • Uploading Files
    • Binary Protocol
      • Sending Binary Request
      • Sending Files
      • Receiving Binary Response
      • Receiving Files Data

  • Structures
    • .ds Store
    • Datetime
    • Event
    • Filenames
    • Metadata
    • Share
    • Tree

  • Methods
    • Intro
      • Global Parameters
      • Authentication
    • General
      • getdigest
      • userinfo
      • supportedlanguages
      • setlanguage
      • feedback
      • currentserver
      • diff
      • getfilehistory
      • getip
      • getapiserver
    • Folder
      • createfolder
      • createfolderifnotexists
      • listfolder
      • renamefolder
      • deletefolder
      • deletefolderrecursive
      • copyfolder
    • File
      • uploadfile
      • uploadprogress
      • downloadfile
      • downloadfileasync
      • copyfile
      • checksumfile
      • deletefile
      • renamefile
      • stat
    • Auth
      • sendverificationemail
      • verifyemail
      • changepassword
      • lostpassword
      • resetpassword
      • register
      • invite
      • userinvites
      • logout
      • listtokens
      • deletetoken
      • sendchangemail
      • changemail
      • senddeactivatemail
      • deactivateuser
    • Streaming
      • getfilelink
      • getvideolink
      • getvideolinks
      • getaudiolink
      • gethlslink
      • gettextfile
    • Archiving
      • getzip
      • getziplink
      • savezip
      • extractarchive
      • extractarchiveprogress
      • savezipprogress
    • Sharing
      • sharefolder
      • listshares
      • sharerequestinfo
      • cancelsharerequest
      • acceptshare
      • declineshare
      • removeshare
      • changeshare
    • Public Links
      • getfilepublink
      • getfolderpublink
      • gettreepublink
      • showpublink
      • getpublinkdownload
      • copypubfile
      • listpublinks
      • listplshort
      • deletepublink
      • changepublink
      • getpubthumb
      • getpubthumblink
      • getpubthumbslinks
      • savepubthumb
      • getpubzip
      • getpubziplink
      • savepubzip
      • getpubvideolinks
      • getpubaudiolink
      • getpubtextfile
      • getcollectionpublink
    • Thumbnails
      • getthumblink
      • getthumbslinks
      • getthumb
      • savethumb
    • Upload Links
      • createuploadlink
      • listuploadlinks
      • deleteuploadlink
      • changeuploadlink
      • showuploadlink
      • uploadtolink
      • uploadlinkprogress
      • copytolink
    • Revisions
      • listrevisions
      • revertrevision
    • Newsletter
      • newsletter_subscribe
      • newsletter_check
      • newsletter_verifyemail
      • newsletter_unsubscribe
      • newsletter_unsibscribemail
    • Trash
      • trash_list
      • trash_restorepath
      • trash_restore
      • trash_clear
    • Collection
      • collection_list
      • collection_details
      • collection_create
      • collection_rename
      • collection_delete
      • collection_linkfiles
      • collection_unlinkfiles
      • collection_move
    • OAuth 2.0
      • authorize
      • oauth2_token
    • Transfer
      • uploadtransfer
      • uploadtransferprogress
    • .ds Store

  • Errors

savethumb

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

ParameterDescription
fileidint id of the file for thumb
pathstring filepath to the file for thumb
sizestring WIDTHxHEIGHT
topathstring filepath where to save the thumb
tofolderidint folder id of the folder where to save the thumb
tonamestring filename to save the thumb
Use fileid or path Use topath or tofolderid+toname

Optional

ParameterDescription
cropint If set, then the thumb will be cropped
typestring If set to png, then the thumb will be in png format
nooverint 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
    }
}

Errors

CodeDescription
1000Log in required.
1004No fileid or path provided.
1014Thumb can not be created from this file type.
1015Please 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).
1016No full topath or toname/tofolderid provided.
2000Log in failed.
2001Invalid file/folder name.
2002A component of parent directory does not exist.
2003Access denied. You do not have permissions to preform this operation.
2004File or folder alredy exists.
2008User is over quota.
2009File not found.
2010Invalid path.
3001Could not create thumb from the given file.
4000Too many login tries from this IP address.
5000Internal error. Try again later.
2014 © pCloud. Terms and Conditions. Privacy Policy. Intellectual Property.
© pCloud. Terms and Conditions. Privacy Policy. Intellectual Property.
Reset Password
Check your e-mail for further instructions.
Reset