Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support folder selection in upload_to_dataset. #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pyclowder/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down