Storage
Storage
firebase::Firebase
-> Storage
Inherited methods
new()
Storage$new(
config_path = "firebase.rds",
session = shiny::getDefaultReactiveDomain()
)
config_path
Path to the configuration file as created by firebase_config
.
session
A valid shiny session.
ref()
path
Path to the file, directory, bucket, or
full URL to file.
If NULL
creates a path to the root.
upload_file()
file
Path to the file to upload.
response
A boolean or character string.
TRUE
indicates that you want to capture the
results of the file upload (e.g.: success or failed)
with get_response
method. FALSE
indicates you do
not want those results back. A character string is
used as named of the response which then can be used
in the get_response
method.
\dontrun{
s <- Storage$new()
# default response
s$
ref("test.png")$
upload_file("path/to/file.png")
observeEvent(s$get_response(), {
# do something
})
# named response
s$
ref("test.png")$
upload_file("path/to/file.png", response = "fl")
observeEvent(s$get_response("fl"), {
# do something
})
}
download_file()
response
A boolean or character string.
TRUE
indicates that you want to capture the
results of the file upload (e.g.: success or failed)
with get_response
method. FALSE
indicates you do
not want those results back. A character string is
used as named of the response which then can be used
in the get_response
method.
delete_file()
response
A boolean or character string.
TRUE
indicates that you want to capture the
results of the file upload (e.g.: success or failed)
with get_response
method. FALSE
indicates you do
not want those results back. A character string is
used as named of the response which then can be used
in the get_response
method.
get_metadata()
response
A boolean or character string.
TRUE
indicates that you want to capture the
results of the file upload (e.g.: success or failed)
with get_response
method. FALSE
indicates you do
not want those results back. A character string is
used as named of the response which then can be used
in the get_response
method.
list_files_all()
## ------------------------------------------------
## Method `Storage$upload_file`
## ------------------------------------------------
if (FALSE) {
s <- Storage$new()
# default response
s$
ref("test.png")$
upload_file("path/to/file.png")
observeEvent(s$get_response(), {
# do something
})
# named response
s$
ref("test.png")$
upload_file("path/to/file.png", response = "fl")
observeEvent(s$get_response("fl"), {
# do something
})
}
## ------------------------------------------------
## Method `Storage$download_file`
## ------------------------------------------------
if (FALSE) {
s <- Storage$new()
s$
ref("test.png")$
upload_file("path/to/file.png")$
download_file("dl")
observeEvent(s$get_response("dl"), {
# do something
})
}