title: How to return base64 video via API
body: <p>I have videos that can be seen only if the user is authenticated. Due to which I decided to return videos in base64 format via API. However, I have quickly identified a problem, having noticed that if the file is greater than 1MB the returned data is truncated.</p>
  
  <p>Example code:</p>
  
  <pre class="lang-php prettyprint-override"><code>$size = Storage::size($video-&gt;path);
  header("Content-length: $size");
  echo base64_encode(Storage::get($video-&gt;path));
  </code></pre>
  
  <pre class="lang-html prettyprint-override"><code>&lt;video :src="'getVideoSrc()" /&gt;
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>getVideo() {
     this.axios.get('video/1').then(result =&gt; {
        this.video = result.data;
     });
  },
  getVideoSrc() {
     return "data:video/mp4;base64," + this.getVideo();
  }
  </code></pre>
  
  <p>How can this be resolved? </p>