title: Laravel 5.4 Image Intervention uploads images on S3 with 0 Bytes
body: <p>I have successfully created a <strong>Laravel 5.4</strong> web application which is hosted on <strong>Heroku</strong>. I have also have managed that images gets uploaded on <strong>AWS S3</strong>. However the images gets uploaded as blank or empty. I have tried various online sources and have not been able to find a solution to my problem. Below I have attached my <strong>controller</strong>, which I believe is causing the error.</p>
  
  <pre><code>    public function updateavatar(Request $request, User $user){
  
  if($request-&gt;hasFile('avatar')){
  
      $avatar = $request-&gt;file('avatar');
      $filename = time() . '.' . $avatar-&gt;getClientOriginalExtension();
      // $destinationPath = public_path('/uploads/avatars/');
  
      $imageS3 = Image::make($avatar)-&gt;resize(300,300);
  
      Storage::disk("s3")-&gt;put($filename, $imageS3-&gt;__toString());
      //$disk-&gt;put("img/album/$id/$filename", $image-&gt;__toString());
  
  $motcall = $this-&gt;carCheck($user);
      $user = Auth::user();
      $user-&gt;avatar = $filename;
      $user-&gt;save();
  
  }
  </code></pre>
  
  <p>An example how the issue looks like in my <strong>bucket</strong>
  <a href="https://i.stack.imgur.com/jgrb9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jgrb9.png" alt="enter image description here"></a></p>