Created
March 20, 2015 21:49
-
-
Save cbare/e9be46c179d9ec7c767b to your computer and use it in GitHub Desktop.
Update the URL of a File within Synapse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import synapseclient | |
| syn = synapseclient.Synapse() | |
| syn.login() | |
| ## create the entity | |
| e = syn.store(File("http://google.com/", name="google", parent="syn3361147", synapseStore=False)) | |
| ## should work, but doesn't | |
| ## e = syn.store(File("http://google.com/testing1", name="google", parent="syn3361147"), synapseStore=False) | |
| fh1 = syn._uploadToFileHandleService("http://google.com/testing2", synapseStore=False) | |
| print fh1 | |
| print e | |
| ## update the entity's file handle and store it | |
| e.properties.dataFileHandleId = fh1['id'] | |
| e = syn.store(e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment