Upload file to pCloud API wih cUrl command

196 Views Asked by At

I'm trying to upload a local file from a linux server, to my pCloud space. I have tried all these commands :

curl "https://eapi.pcloud.com/uploadfile?path=/my_cloud_folder&filename=/home/www/tmp/file.txt&access_token=TOKEN_ID"

or

curl "https://eapi.pcloud.com/uploadfile" -X POST --data 'filename=/home/www/file.txt&access_token=TOKEN_ID'

or

curl -d @/home/www/tmp/file.txt "https://eapi.pcloud.com/uploadfile?access_token=TOKEN_ID"

or

curl -X PUT -d '{"filename": "/home/www/tmp/file.txt", "path": "/my_cloud_folder"}' https://eapi.pcloud.com/uploadfile?access_token=TOKEN_ID

or

curl --request PUT --url 'https://eapi.pcloud.com/uploadfile?access_token=TOKEN_ID' --data '"value": { "filename": "/home/www/tmp/file.txt", "path": "/my_cloud_folder" }'

And every time I get this error :

{
        "result": 0,
        "metadata": [

        ],
        "checksums": [

        ],
        "fileids": [

        ]
}

Any idea?

Many thanks

1

There are 1 best solutions below

0
On

problem solved, here is the right command :

curl -F 'file=@/path/to/file' "https://eapi.pcloud.com/uploadfile?folderid=0&access_token=<ACCESS_TOKEN>"