-
-
Save gordonwoodhull/8bf3ccc607b4164c8f22 to your computer and use it in GitHub Desktop.
anonymous upload example
This file contains 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
# load the JS function that will register the ocaps | |
setup <- rcloud.install.js.module("upload_funcs", | |
rcloud.get.notebook.file("upload_funcs.js"), TRUE); | |
# create a structure of the ocaps needed for file upload | |
make.oc <- rcloud.support:::make.oc | |
file_upload = list( | |
create = make.oc(rcloud.upload.create.file), | |
write = make.oc(rcloud.upload.write.file), | |
close = make.oc(rcloud.upload.close.file), | |
upload_path = make.oc(rcloud.upload.path) | |
) | |
# and register them in window.upload_caps for use in the file selector below | |
setup$setup_upload_ocaps(file_upload); |
This file contains 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
({ | |
setup_upload_ocaps: function(ocaps, k) { | |
var paths = [["upload_path"], | |
["create"], | |
["write"], | |
["close"]]; | |
window.upload_ocaps = RCloud.promisify_paths(ocaps, paths); | |
k(); | |
return; | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment