How can I upload a file to a pCloud folder using python?

864 Views Asked by At

Files only upload to the root folder:

from pcloud import PyCloud

pc = PyCloud('username','password')

pc.uploadfile(files = ['pics\\img.png'])

I couldn't find any arguments like destination or dest.

2

There are 2 best solutions below

0
On

you could do like the following:

from pcloud import PyCloud

pc = PyCloud('username','password')

pc.uploadfile(files=['/full/path/to/image1.jpg', '/Users/tom/another/image.png'],
              path='/path-to-pcloud-dir')

Reference: pcloud - A Python API client for pCloud

0
On

Actually you can use all methods the pClooud API provides.

Both

>>> pc.uploadfile(files=['/full/path/to/image1.jpg', '/Users/tom/another/image.png'],
                  path='/path-to-pcloud-dir')

and

>>> pc.uploadfile(files=['/full/path/to/image1.jpg', '/Users/tom/another/image.png'],
                  folderid=0)

are possible.