<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Storage — Storage • firebase</title><!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png"><link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png"><link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png"><link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png"><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css"><script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><meta property="og:title" content="Storage — Storage"><meta property="og:description" content="Storage
Storage"><meta property="og:image" content="/logo.png"><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]--></head><body data-spy="scroll" data-target="#toc">
    

    <div class="container template-reference-topic">
      <header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <span class="navbar-brand">
        <a class="navbar-link" href="../index.html">firebase</a>
        <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">1.0.1.9000</span>
      </span>
    </div>

    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav"><li>
  <a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
    Articles
     
    <span class="caret"></span>
  </a>
  <ul class="dropdown-menu" role="menu"><li>
      <a href="../articles/analytics.html">Storage</a>
    </li>
    <li>
      <a href="../articles/demo.html">Demo</a>
    </li>
    <li>
      <a href="../articles/email-link.html">Email Link</a>
    </li>
    <li>
      <a href="../articles/email-password.html">Email &amp; Password</a>
    </li>
    <li>
      <a href="../articles/flow.html">flow</a>
    </li>
    <li>
      <a href="../articles/get-started.html">Get Started</a>
    </li>
    <li>
      <a href="../articles/manage.html">Manage Users</a>
    </li>
    <li>
      <a href="../articles/oauth-providers.html">Oauth Providers</a>
    </li>
    <li>
      <a href="../articles/phone.html">phone</a>
    </li>
    <li>
      <a href="../articles/social.html">Social Sites</a>
    </li>
    <li>
      <a href="../articles/state-persistence.html">state-persistence</a>
    </li>
    <li>
      <a href="../articles/storage.html">Storage</a>
    </li>
    <li>
      <a href="../articles/ui.html">Prebuilt UI</a>
    </li>
  </ul></li>
<li>
  <a href="../news/index.html">Changelog</a>
</li>
      </ul><ul class="nav navbar-nav navbar-right"><li>
  <a href="https://github.com/JohnCoene/firebase/" class="external-link">
    <span class="fab fa-github fa-lg"></span>
     
  </a>
</li>
      </ul></div><!--/.nav-collapse -->
  </div><!--/.container -->
</div><!--/.navbar -->

      

      </header><div class="row">
  <div class="col-md-9 contents">
    <div class="page-header">
    <h1>Storage</h1>
    <small class="dont-index">Source: <a href="https://github.com/JohnCoene/firebase/blob/HEAD/R/class-storage.R" class="external-link"><code>R/class-storage.R</code></a></small>
    <div class="hidden name"><code>Storage.Rd</code></div>
    </div>

    <div class="ref-description">
    <p>Storage</p>
<p>Storage</p>
    </div>


    <div id="super-class">
    <h2>Super class</h2>
    <p><code><a href="Firebase.html">firebase::Firebase</a></code> -&gt; <code>Storage</code></p>
    </div>
    <div id="methods">
    <h2>Methods</h2>
    
<div class="section">
<h3 id="public-methods">Public methods<a class="anchor" aria-label="anchor" href="#public-methods"></a></h3>

<ul><li><p><a href="#method-Storage-new"><code>Storage$new()</code></a></p></li>
<li><p><a href="#method-Storage-ref"><code>Storage$ref()</code></a></p></li>
<li><p><a href="#method-Storage-upload_file"><code>Storage$upload_file()</code></a></p></li>
<li><p><a href="#method-Storage-download_file"><code>Storage$download_file()</code></a></p></li>
<li><p><a href="#method-Storage-delete_file"><code>Storage$delete_file()</code></a></p></li>
<li><p><a href="#method-Storage-get_metadata"><code>Storage$get_metadata()</code></a></p></li>
<li><p><a href="#method-Storage-list_files_all"><code>Storage$list_files_all()</code></a></p></li>
<li><p><a href="#method-Storage-get_response"><code>Storage$get_response()</code></a></p></li>
<li><p><a href="#method-Storage-clone"><code>Storage$clone()</code></a></p></li>
</ul></div><p><details open><summary>Inherited methods</summary><ul><li><span class="pkg-link" data-pkg="firebase" data-topic="Firebase" data-id="expose_app"><a href="Firebase.html#method-expose_app"><code>firebase::Firebase$expose_app()</code></a></span></li>
<li><span class="pkg-link" data-pkg="firebase" data-topic="Firebase" data-id="print"><a href="Firebase.html#method-print"><code>firebase::Firebase$print()</code></a></span></li>
</ul></details></p><hr><a id="method-Storage-new"></a><div class="section">
<h3 id="method-new-">Method <code><a href="https://rdrr.io/r/methods/new.html" class="external-link">new()</a></code><a class="anchor" aria-label="anchor" href="#method-new-"></a></h3>

<div class="section">
<h4 id="usage">Usage<a class="anchor" aria-label="anchor" href="#usage"></a></h4>
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va"><a href="../reference/Storage.html">Storage</a></span><span class="op">$</span><span class="fu">new</span><span class="op">(</span></span>
<span>  config_path <span class="op">=</span> <span class="st">"firebase.rds"</span>,</span>
<span>  session <span class="op">=</span> <span class="fu">shiny</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/pkg/shiny/man/domains.html" class="external-link">getDefaultReactiveDomain</a></span><span class="op">(</span><span class="op">)</span></span>
<span><span class="op">)</span></span></code></pre></div><p></p></div>
</div>

<div class="section">
<h4 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#arguments"></a></h4>
<p></p><div class="arguments"><dl><dt><code>config_path</code></dt>
<dd><p>Path to the configuration file as created by <code><a href="config.html">firebase_config</a></code>.</p></dd>


<dt><code>session</code></dt>
<dd><p>A valid shiny session.</p></dd>


</dl><p></p></div>
</div>
<div class="section">
<h4 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h4>
<p>Initialiases Firebase Storage</p>
<p>Initialises the Firebase Storage application client-side.</p>
</div>


</div><p></p><hr><a id="method-Storage-ref"></a><div class="section">
<h3 id="method-ref-">Method <code>ref()</code><a class="anchor" aria-label="anchor" href="#method-ref-"></a></h3>

<div class="section">
<h4 id="usage-1">Usage<a class="anchor" aria-label="anchor" href="#usage-1"></a></h4>
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">Storage</span><span class="op">$</span><span class="fu">ref</span><span class="op">(</span>path <span class="op">=</span> <span class="cn">NULL</span><span class="op">)</span></span></code></pre></div><p></p></div>
</div>

<div class="section">
<h4 id="arguments-1">Arguments<a class="anchor" aria-label="anchor" href="#arguments-1"></a></h4>
<p></p><div class="arguments"><dl><dt><code>path</code></dt>
<dd><p>Path to the file, directory, bucket, or
full URL to file.
If <code>NULL</code> creates a path to the root.</p></dd>


</dl><p></p></div>
</div>
<div class="section">
<h4 id="details-1">Details<a class="anchor" aria-label="anchor" href="#details-1"></a></h4>
<p>Reference</p>
<p>Creates a reference to a file or directory you want to operate on.
Note that this reference persists, make sure you change it
between operations.</p>
</div>

<div class="section">
<h4 id="returns">Returns<a class="anchor" aria-label="anchor" href="#returns"></a></h4>
<p>Invisibly return the class instance.</p>
</div>

</div><p></p><hr><a id="method-Storage-upload_file"></a><div class="section">
<h3 id="method-upload-file-">Method <code>upload_file()</code><a class="anchor" aria-label="anchor" href="#method-upload-file-"></a></h3>

<div class="section">
<h4 id="usage-2">Usage<a class="anchor" aria-label="anchor" href="#usage-2"></a></h4>
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">Storage</span><span class="op">$</span><span class="fu">upload_file</span><span class="op">(</span><span class="va">file</span>, response <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></code></pre></div><p></p></div>
</div>

<div class="section">
<h4 id="arguments-2">Arguments<a class="anchor" aria-label="anchor" href="#arguments-2"></a></h4>
<p></p><div class="arguments"><dl><dt><code>file</code></dt>
<dd><p>Path to the file to upload.</p></dd>


<dt><code>response</code></dt>
<dd><p>A boolean or character string.
<code>TRUE</code> indicates that you want to capture the
results of the file upload (e.g.: success or failed)
with <code>get_response</code> method. <code>FALSE</code> 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 <code>get_response</code> method.</p></dd>


</dl><p></p></div>
</div>
<div class="section">
<h4 id="details-2">Details<a class="anchor" aria-label="anchor" href="#details-2"></a></h4>
<p>Upload a File</p>
<p>Upload a file to the store system or bucket.
Requires a valid authentication.</p>
</div>

<div class="section">
<h4 id="examples">Examples<a class="anchor" aria-label="anchor" href="#examples"></a></h4>
<p></p><div class="r example copy"><div class="sourceCode"><pre><code>\dontrun{
s &lt;- 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
})
}
</code></pre></div><p></p></div>
</div>


</div><p></p><hr><a id="method-Storage-download_file"></a><div class="section">
<h3 id="method-download-file-">Method <code>download_file()</code><a class="anchor" aria-label="anchor" href="#method-download-file-"></a></h3>

<div class="section">
<h4 id="usage-3">Usage<a class="anchor" aria-label="anchor" href="#usage-3"></a></h4>
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">Storage</span><span class="op">$</span><span class="fu">download_file</span><span class="op">(</span>response <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></code></pre></div><p></p></div>
</div>

<div class="section">
<h4 id="arguments-3">Arguments<a class="anchor" aria-label="anchor" href="#arguments-3"></a></h4>
<p></p><div class="arguments"><dl><dt><code>response</code></dt>
<dd><p>A boolean or character string.
<code>TRUE</code> indicates that you want to capture the
results of the file upload (e.g.: success or failed)
with <code>get_response</code> method. <code>FALSE</code> 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 <code>get_response</code> method.</p></dd>


</dl><p></p></div>
</div>
<div class="section">
<h4 id="details-3">Details<a class="anchor" aria-label="anchor" href="#details-3"></a></h4>
<p>Download a File</p>
<p>Download a file from the store system or bucket.
Requires a valid authentication.</p>
</div>

<div class="section">
<h4 id="examples-1">Examples<a class="anchor" aria-label="anchor" href="#examples-1"></a></h4>
<p></p><div class="r example copy"><div class="sourceCode"><pre><code>\dontrun{
s &lt;- Storage$new()

s$
  ref("test.png")$
  upload_file("path/to/file.png")$
  download_file("dl")

observeEvent(s$get_response("dl"), {
  # do something
})
}
</code></pre></div><p></p></div>
</div>


</div><p></p><hr><a id="method-Storage-delete_file"></a><div class="section">
<h3 id="method-delete-file-">Method <code>delete_file()</code><a class="anchor" aria-label="anchor" href="#method-delete-file-"></a></h3>

<div class="section">
<h4 id="usage-4">Usage<a class="anchor" aria-label="anchor" href="#usage-4"></a></h4>
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">Storage</span><span class="op">$</span><span class="fu">delete_file</span><span class="op">(</span>response <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></code></pre></div><p></p></div>
</div>

<div class="section">
<h4 id="arguments-4">Arguments<a class="anchor" aria-label="anchor" href="#arguments-4"></a></h4>
<p></p><div class="arguments"><dl><dt><code>response</code></dt>
<dd><p>A boolean or character string.
<code>TRUE</code> indicates that you want to capture the
results of the file upload (e.g.: success or failed)
with <code>get_response</code> method. <code>FALSE</code> 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 <code>get_response</code> method.</p></dd>


</dl><p></p></div>
</div>
<div class="section">
<h4 id="details-4">Details<a class="anchor" aria-label="anchor" href="#details-4"></a></h4>
<p>Delete a File</p>
<p>Delete a file from the store system or bucket.
Requires a valid authentication.</p>
</div>


</div><p></p><hr><a id="method-Storage-get_metadata"></a><div class="section">
<h3 id="method-get-metadata-">Method <code>get_metadata()</code><a class="anchor" aria-label="anchor" href="#method-get-metadata-"></a></h3>

<div class="section">
<h4 id="usage-5">Usage<a class="anchor" aria-label="anchor" href="#usage-5"></a></h4>
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">Storage</span><span class="op">$</span><span class="fu">get_metadata</span><span class="op">(</span>response <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></code></pre></div><p></p></div>
</div>

<div class="section">
<h4 id="arguments-5">Arguments<a class="anchor" aria-label="anchor" href="#arguments-5"></a></h4>
<p></p><div class="arguments"><dl><dt><code>response</code></dt>
<dd><p>A boolean or character string.
<code>TRUE</code> indicates that you want to capture the
results of the file upload (e.g.: success or failed)
with <code>get_response</code> method. <code>FALSE</code> 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 <code>get_response</code> method.</p></dd>


</dl><p></p></div>
</div>
<div class="section">
<h4 id="details-5">Details<a class="anchor" aria-label="anchor" href="#details-5"></a></h4>
<p>File Metadata</p>
<p>Get the metadata of a file from the store system or bucket.
Requires a valid authentication.</p>
</div>


</div><p></p><hr><a id="method-Storage-list_files_all"></a><div class="section">
<h3 id="method-list-files-all-">Method <code>list_files_all()</code><a class="anchor" aria-label="anchor" href="#method-list-files-all-"></a></h3>

<div class="section">
<h4 id="usage-6">Usage<a class="anchor" aria-label="anchor" href="#usage-6"></a></h4>
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">Storage</span><span class="op">$</span><span class="fu">list_files_all</span><span class="op">(</span>response <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></code></pre></div><p></p></div>
</div>

<div class="section">
<h4 id="arguments-6">Arguments<a class="anchor" aria-label="anchor" href="#arguments-6"></a></h4>
<p></p><div class="arguments"><dl><dt><code>response</code></dt>
<dd><p>A boolean or character string.
<code>TRUE</code> indicates that you want to capture the
results of the file upload (e.g.: success or failed)
with <code>get_response</code> method. A character string is
used as named of the response which then can be used
in the <code>get_response</code> method.</p></dd>


</dl><p></p></div>
</div>
<div class="section">
<h4 id="details-6">Details<a class="anchor" aria-label="anchor" href="#details-6"></a></h4>
<p>List All Files</p>
<p>List all files in the reference (<code>ref</code>).
Requires a valid authentication.</p>
</div>


</div><p></p><hr><a id="method-Storage-get_response"></a><div class="section">
<h3 id="method-get-response-">Method <code>get_response()</code><a class="anchor" aria-label="anchor" href="#method-get-response-"></a></h3>

<div class="section">
<h4 id="usage-7">Usage<a class="anchor" aria-label="anchor" href="#usage-7"></a></h4>
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">Storage</span><span class="op">$</span><span class="fu">get_response</span><span class="op">(</span>response <span class="op">=</span> <span class="cn">NULL</span><span class="op">)</span></span></code></pre></div><p></p></div>
</div>

<div class="section">
<h4 id="arguments-7">Arguments<a class="anchor" aria-label="anchor" href="#arguments-7"></a></h4>
<p></p><div class="arguments"><dl><dt><code>response</code></dt>
<dd><p>Name of the response.</p></dd>


</dl><p></p></div>
</div>
<div class="section">
<h4 id="details-7">Details<a class="anchor" aria-label="anchor" href="#details-7"></a></h4>
<p>Capture response</p>
</div>


</div><p></p><hr><a id="method-Storage-clone"></a><div class="section">
<h3 id="method-clone-">Method <code>clone()</code><a class="anchor" aria-label="anchor" href="#method-clone-"></a></h3>
<p>The objects of this class are cloneable with this method.</p><div class="section">
<h4 id="usage-8">Usage<a class="anchor" aria-label="anchor" href="#usage-8"></a></h4>
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">Storage</span><span class="op">$</span><span class="fu">clone</span><span class="op">(</span>deep <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></span></code></pre></div><p></p></div>
</div>

<div class="section">
<h4 id="arguments-8">Arguments<a class="anchor" aria-label="anchor" href="#arguments-8"></a></h4>
<p></p><div class="arguments"><dl><dt><code>deep</code></dt>
<dd><p>Whether to make a deep clone.</p></dd>


</dl><p></p></div>
</div>

</div>

    </div>

    <div id="ref-examples">
    <h2>Examples</h2>
    <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co">## ------------------------------------------------</span></span></span>
<span class="r-in"><span><span class="co">## Method `Storage$upload_file`</span></span></span>
<span class="r-in"><span><span class="co">## ------------------------------------------------</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="cn">FALSE</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span><span class="va">s</span> <span class="op">&lt;-</span> <span class="va">Storage</span><span class="op">$</span><span class="fu">new</span><span class="op">(</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># default response</span></span></span>
<span class="r-in"><span><span class="va">s</span><span class="op">$</span></span></span>
<span class="r-in"><span>  <span class="fu">ref</span><span class="op">(</span><span class="st">"test.png"</span><span class="op">)</span><span class="op">$</span></span></span>
<span class="r-in"><span>  <span class="fu">upload_file</span><span class="op">(</span><span class="st">"path/to/file.png"</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/pkg/shiny/man/observeEvent.html" class="external-link">observeEvent</a></span><span class="op">(</span><span class="va">s</span><span class="op">$</span><span class="fu">get_response</span><span class="op">(</span><span class="op">)</span>, <span class="op">{</span></span></span>
<span class="r-in"><span>  <span class="co"># do something</span></span></span>
<span class="r-in"><span><span class="op">}</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># named response</span></span></span>
<span class="r-in"><span><span class="va">s</span><span class="op">$</span></span></span>
<span class="r-in"><span>  <span class="fu">ref</span><span class="op">(</span><span class="st">"test.png"</span><span class="op">)</span><span class="op">$</span></span></span>
<span class="r-in"><span>  <span class="fu">upload_file</span><span class="op">(</span><span class="st">"path/to/file.png"</span>, response <span class="op">=</span> <span class="st">"fl"</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/pkg/shiny/man/observeEvent.html" class="external-link">observeEvent</a></span><span class="op">(</span><span class="va">s</span><span class="op">$</span><span class="fu">get_response</span><span class="op">(</span><span class="st">"fl"</span><span class="op">)</span>, <span class="op">{</span></span></span>
<span class="r-in"><span>  <span class="co"># do something</span></span></span>
<span class="r-in"><span><span class="op">}</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">}</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co">## ------------------------------------------------</span></span></span>
<span class="r-in"><span><span class="co">## Method `Storage$download_file`</span></span></span>
<span class="r-in"><span><span class="co">## ------------------------------------------------</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="cn">FALSE</span><span class="op">)</span> <span class="op">{</span></span></span>
<span class="r-in"><span><span class="va">s</span> <span class="op">&lt;-</span> <span class="va">Storage</span><span class="op">$</span><span class="fu">new</span><span class="op">(</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">s</span><span class="op">$</span></span></span>
<span class="r-in"><span>  <span class="fu">ref</span><span class="op">(</span><span class="st">"test.png"</span><span class="op">)</span><span class="op">$</span></span></span>
<span class="r-in"><span>  <span class="fu">upload_file</span><span class="op">(</span><span class="st">"path/to/file.png"</span><span class="op">)</span><span class="op">$</span></span></span>
<span class="r-in"><span>  <span class="fu">download_file</span><span class="op">(</span><span class="st">"dl"</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/pkg/shiny/man/observeEvent.html" class="external-link">observeEvent</a></span><span class="op">(</span><span class="va">s</span><span class="op">$</span><span class="fu">get_response</span><span class="op">(</span><span class="st">"dl"</span><span class="op">)</span>, <span class="op">{</span></span></span>
<span class="r-in"><span>  <span class="co"># do something</span></span></span>
<span class="r-in"><span><span class="op">}</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="op">}</span></span></span>
</code></pre></div>
    </div>
  </div>
  <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
    <nav id="toc" data-toggle="toc" class="sticky-top"><h2 data-toc-skip>Contents</h2>
    </nav></div>
</div>


      <footer><div class="copyright">
  <p></p><p>Developed by John Coene.</p>
</div>

<div class="pkgdown">
  <p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.7.</p>
</div>

      </footer></div>

  


  

  </body></html>

