title: Firebase Storage User Ref
body: <p>I'm using Firebase for a project, I need to store images in a folder for the users. For example, images/userId/images. At this moment, the rules of my Firebase database rules are:</p>
  
  <pre><code>service firebase.storage {
    enter code here`match /b/&lt;your-firbase-storage-bucket&gt;/o {
      // Files look like: "user/&lt;UID&gt;/path/to/file.txt"
      match /user/{userId}/{allPaths=**} {
        allow read, write: if request.auth.uid == userId;
      }
    }
  }
  </code></pre>
  
  <p>But I don't know how to put the ref in my code for point to the correct folder in database.</p>
  
  <p>I tried below in my code, but didn't work. </p>
  
  <pre><code>const storageRef = firebase.storage().ref(Items/${file.name}
  </code></pre>
  
  <p>What should I do to refer correctly my code to the Firebase storage?</p>