Skip to content

Commit 8939ecc

Browse files
committed
in case folder id is none
1 parent f8836e6 commit 8939ecc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pyclowder/api/v2/files.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,9 @@ def upload_to_dataset(connector, client, datasetid, filepath, folder_id=None, ch
349349
if filepath.startswith(connector.mounted_paths[source_path]):
350350
return _upload_to_dataset_local(connector, client, datasetid, filepath)
351351

352-
url = '%s/api/v2/datasets/%s/files?folder_id=%s' % (client.host, datasetid, folder_id)
352+
url = '%s/api/v2/datasets/%s/files' % (client.host, datasetid)
353+
if folder_id is not None:
354+
url = '%s?folder_id=%s' % (url, folder_id)
353355

354356
if os.path.exists(filepath):
355357
filename = os.path.basename(filepath)

0 commit comments

Comments
 (0)