From a53887a08ea016b564eddb554a3f07c4279e343b Mon Sep 17 00:00:00 2001 From: Terry Brown Date: Mon, 22 Apr 2024 12:26:26 -0500 Subject: [PATCH] Support folder upload --- pyclowder/files.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyclowder/files.py b/pyclowder/files.py index cfe3b27..e075fbc 100644 --- a/pyclowder/files.py +++ b/pyclowder/files.py @@ -248,7 +248,7 @@ def upload_thumbnail(connector, host, key, fileid, thumbnail): fileid -- the file that the thumbnail should be associated with thumbnail -- the file containing the thumbnail """ - + client = ClowderClient(host=host, key=key) thumbnail_id = files.upload_thumbnail(connector, client, fileid, thumbnail) return thumbnail_id @@ -284,6 +284,8 @@ def upload_to_dataset(connector, host, key, datasetid, filepath, check_duplicate return _upload_to_dataset_local(connector, client.host, client.key, datasetid, filepath) url = posixpath.join(client.host, 'api/uploadToDataset/%s?key=%s' % (datasetid, client.key)) + if folder_id: + url += "&folder_id=%s" % folder_id if os.path.exists(filepath): filename = os.path.basename(filepath)