title: How to upload URL-based mp3 file from the client to the node server
body: <p>I'm trying to upload a mp3 file to node server using fetch.</p>
  <p>Is the below code correct way to do this?</p>
  <pre><code> var song;
    toDataUrl('http://s5.qhres.com/static/465f1f953f1e6ff2.mp3', function(myBase64) {
      // console.log(myBase64); // myBase64 is the base64 string
      song = myBase64;
  });
  
    fetch(&quot;/ffmpegserver/upload&quot;, {
      method: 'PUT',
      headers: { 'Accept': 'audio/mpeg', 'Content-Type': 'audio/mpeg' },
      body: song
    })
      .then(response =&gt; {
        console.log(&quot;Got response after uploading song:&quot;, response);
      })
      .catch(error =&gt; {
        console.log(&quot;Error in Firebase AC upload song: &quot;, error);
      });
  }
  </code></pre>
  <p>If so, how can I receive it and write the file as mp3 in the node server?</p>
  <pre><code>app.put(&quot;/ffmpegserver/upload&quot;, (req, res) =&gt; {
    var mp3SongName = &quot;output/test.mp3&quot;;
    var mp3_file = fs.createWriteStream(mp3SongName);
  // how to write the mp3 file?
  }
  </code></pre>