Created
July 20, 2017 08:46
-
-
Save jarvisluong/8371f07e284eec66de9987c9ccedec43 to your computer and use it in GitHub Desktop.
Upload file to Pcloud via Rest API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while : | |
do | |
zip -r $ZIP_FILENAME $FOLDERNAME && curl -F 'filename=@$ZIP_FILENAME' 'https://api.pcloud.com/uploadtolink?code=$PCLOUD_UPLOAD_CODE' && rm -f $ZIP_FILENAME && sleep $SLEEPTIME | |
done | |
#ZIP_FILENAME: file name of the zip you want to name it | |
#FOLDERNAME: the folder you want to zip | |
#PCLOUD_UPLOAD_CODE: go to pcloud, generate an upload link, you will find the code | |
#SLEEPTIME: the sleep interval for each upload cycle, if you want this to be a loop |
I get a 2001 ("Invalid file/folder name.") error, do you?
I get a 2001 ("Invalid file/folder name.") error, do you?
Same here
- You have to add a parameter "names" (string, freetext) along with the "code". I guess this is a change from pCloud's API and it's not yet documented.
https://api.pcloud.com/uploadtolink?code=$PCLOUD_UPLOAD_CODE
should be
https://api.pcloud.com/uploadtolink?names=User&code=$PCLOUD_UPLOAD_CODE
- The name of the POST file parameter should be changed from
filename
to justfile
.
'filename=@$ZIP_FILENAME'
should be
'file=@$ZIP_FILENAME'
@npetrovski, you are the man! It is working. Thank you.
ZIP_FILENAME=FULL_PATH
NAMES=AnyName
PCLOUD_UPLOAD_CODE=XYZ
curl -F "file=@$ZIP_FILENAME" "https://api.pcloud.com/uploadtolink?names=$NAMES&code=$PCLOUD_UPLOAD_CODE"
alguma atualização para 2023 ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have tried it, but it does not seem to work?
Any update to this?
Thanks.