HumanBrainProject / ebrains-storage

Python client interface for EBRAINS Collaboratory Drive (Seafile) and Bucket (data-proxy) storage
Apache License 2.0
8 stars 3 forks source link

Unable to upload files in Drive subfolder #12

Closed lbologna closed 2 years ago

lbologna commented 2 years ago

Hello,

We are getting a 403 error when we try to upload a file to a subfolder of a Collab's Drive, while the upload works well when uploading to the root folder.

Here's the code that works:

import ebrains_drive
COLLAB_URL = 'https://wiki.ebrains.eu/bin/view/Collabs/hhnb-registeredmodels/'
COLLAB_DIR = ''
client = ebrains_drive.connect(username="lbologna", password="XXXXXX")
repo = client.repos.get_repo_by_url(COLLAB_URL)
seafdir = repo.get_dir('/' + COLLAB_DIR)
uploaded_file = seafdir.upload_local_file("./test_LLB")

The same code does not work anymore when we set the following:

COLLAB_DIR = 'hhnb_wf_model'

Any clue on this?

Thank you.

appukuttan-shailesh commented 2 years ago

Hey @lbologna , Just coincidentally I had opened a PR this morning to fix this isssue. See here: https://github.com/HumanBrainProject/ebrains-drive/pull/11

rcsm17 commented 2 years ago

Hey @lbologna , Just coincidentally I had opened a PR this morning to fix this isssue. See here: #11

Hi @appukuttan-shailesh, the fix you provided resolves this issue. Thank you !

Cracky5457 commented 2 years ago

A new release 0.3.0 including shailesh changed is available on pip install ebrains-drive

Thanks for reporting and fixing it.

Axel

appukuttan-shailesh commented 2 years ago

Thanks Axel for the quick action. I have tested the new release, and it seems to be working fine :+1: