• 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
    • Datetime
    • Event
    • File Descriptors
    • 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
    • Fileops
      • file_open
      • file_write
      • file_pwrite
      • file_read
      • file_pread
      • file_pread_ifmod
      • file_checksum
      • file_size
      • file_truncate
      • file_seek
      • file_close
      • file_lock
    • 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

  • Errors

downloadfile

Name

downloadfile

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 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:

FieldDescription
urlcountint number of URLs requested
urlreadyint number of URLs already downloaded
urlworkingint number of currently downloading URLs
finishedbool true if all URLs are downloaded
filesarray of objects
Each record in files has:
FieldDescription
urlstring the url
statusstring One of:
  • waiting the link is waiting for its turn to be downloaded
  • downloading the link is currently being downloaded
  • ready the file pointed by url is already downloaded
  • error error occured while downloading (timeout, 404, server not responding)
sizeint available only for started downloads only when the server supplied Content-Length - the size of the file
downloadedint available only for started downloads - number of bytes downloaded so far (goes up to size)
metadatametadata available only for ready downloads - the metadata of the file in the user's filesystem
The files are saved with the names, that are defined from the urls given. These names could be set, using the parameter target, which should contain comma-separeted urlencoded list of the desired names. The n-th name in this sequence is given to the n-th url from url parameter.

Note that not all urls could have name given with target. If so, leave the name empty ( 'name%20A,,name%20C' ), or stop the list on the last desired name (urls can be more than target names).

URL

https://api.pcloud.com/downloadfile

Required

ParameterDescription
urlstring links separated by any amount of whitespace

Optional

ParameterDescription
pathstring path to folder, in which to download the files
folderidstring folderid of the folder, in which to download the files
targetstring desired names for the downloaded files
If path or folderid are not present, then root folder is used

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"
        }
    ]
}

Errors

CodeDescription
1000Log in required.
1040Please provide 'url'.
2000Log in failed.
2003Access denied. You do not have permissions to preform this operation.
2005Directory does not exist.
2008User is over quota.
4000Too many login tries from this IP address.
5000Internal error. Try again later.
5001Internal upload error.
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