Skip to content

Commit a53887a

Browse files
committed
Support folder upload
1 parent 8015028 commit a53887a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pyclowder/files.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def upload_thumbnail(connector, host, key, fileid, thumbnail):
248248
fileid -- the file that the thumbnail should be associated with
249249
thumbnail -- the file containing the thumbnail
250250
"""
251-
251+
252252
client = ClowderClient(host=host, key=key)
253253
thumbnail_id = files.upload_thumbnail(connector, client, fileid, thumbnail)
254254
return thumbnail_id
@@ -284,6 +284,8 @@ def upload_to_dataset(connector, host, key, datasetid, filepath, check_duplicate
284284
return _upload_to_dataset_local(connector, client.host, client.key, datasetid, filepath)
285285

286286
url = posixpath.join(client.host, 'api/uploadToDataset/%s?key=%s' % (datasetid, client.key))
287+
if folder_id:
288+
url += "&folder_id=%s" % folder_id
287289

288290
if os.path.exists(filepath):
289291
filename = os.path.basename(filepath)

0 commit comments

Comments
 (0)