The ‘add file’ feature allows users to add any desired files to their resource in HyrdoShare. This feature works smoothly without any glitches.
To try this on your own, you can use the code snippet below that is used in this demonstration.
from hs_restclient import HydroShare, HydroShareAuthBasic
auth = HydroShareAuthBasic(username= username, password= password)
hs = HydroShare(auth=auth)
fpath = temp_zip_path
resource_id = hs.addResourceFile(resourcein, fpath)
messages.error(request, "File added successfully")
if has_errors:
messages.error(request, "Please fix errors.")