title: firebase functions upload file from web via stream only partially working
body: <p>I am trying to create a firebase function that downloads a photo off the web via URL and uploads it to firebase storage.</p>
  <p>Using Axios to stream the file to the bucket. it appears the file gets uploaded but i cant download or view it.</p>
  <p>This is my code:</p>
  <pre><code>let fileURL = 'https://www.example.file.path.png'
  
  let myFile = await axios.get(fileURL, { responseType: 'stream' })
  let destFile = bucket.file(photoId).createWriteStream({ contentType: myFile.headers['content-type']})
  myFile.data.pipe(destFile)
  </code></pre>
  <p>And here is the storage console from firebase:
  <a href="https://i.stack.imgur.com/EW6Su.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EW6Su.png" alt="enter image description here" /></a></p>
  <p>I have messed around with the storage api and attempted using the upload and save functions. using axios get and write streams is the closest that I'v got to getting this to work.</p>
  <p>Reading the <a href="https://firebase.google.com/docs/storage/extend-with-functions#example_image_transformation" rel="nofollow noreferrer">example</a> in the docs only aids in my confusion because the file is never reference in the upload function.. just the file name??</p>
  <p>Feel like i'm almost there considering the file or rather the name of the file is there and the size and the type.. just not the content?</p>