hydroshare / hs_restclient

Python client for the https://www.hydroshare.org REST API
BSD 3-Clause "New" or "Revised" License
6 stars 8 forks source link

hs.addResourceFile always adds to root directory #112

Open Castronova opened 4 years ago

Castronova commented 4 years ago

When using hs.addResourceFile, files are always added to the root directory of the resource regardless if a different resource_filename is provided. It does, however, successfully rename files when using resource_filename though. To reproduce;

import hs_restclient
hs = hs.HydroShare()
  Username: <username>
  Password: <password>
response = hs.addResourceFile(<resource id>,
                              "/tmp/myfile.txt", 
                              resource_filename='mydirectory/abcd.txt')

print(response['file_path'])
abcd.txt

# EXPECTED mydirectory/abcd.txt