Skip to content

Instantly share code, notes, and snippets.

@maxogden

maxogden/upload.sh

Created Mar 27, 2019
Embed
What would you like to do?
upload large file to zenodo from command line (curl)
# in zenodo ui create a deposition. get the id
curl -H "Accept: application/json" -H "Authorization: Bearer $TOKEN" "https://www.zenodo.org/api/deposit/depositions/$DEPOSITION"
# get the bucket id from above
curl --progress-bar -o /dev/null --upload-file ./$FILE https://www.zenodo.org/api/files/$BUCKET/$FILE?access_token=$TOKEN
@jhpoelen

This comment has been minimized.

Copy link

@jhpoelen jhpoelen commented Jun 21, 2019

nice! super helpful.

I added:

# in zenodo ui create a deposition. get the id
set -xe

DEPOSITION=$1
FILEPATH=$2
FILENAME=$(echo $FILEPATH | sed 's+.*/++g')

BUCKET=$(curl -H "Accept: application/json" -H "Authorization: Bearer $ZENODO_TOKEN" "https://www.zenodo.org/api/deposit/depositions/$DEPOSITION" | jq --raw-output .links.bucket)


curl --progress-bar -o /dev/null --upload-file $FILEPATH $BUCKET/$FILENAME?access_token=$ZENODO_TOKEN
@maxogden

This comment has been minimized.

Copy link
Owner Author

@maxogden maxogden commented Jun 21, 2019

greetings @jhpoelen !

@jhpoelen

This comment has been minimized.

Copy link

@jhpoelen jhpoelen commented Jun 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.