title: How to upload base64 encoded image to Amazon S3 without temporarily saving on file system with official PHP SDK?
body: <p>I have a "screenshot" of a div using a javascript library named <a href="https://github.com/niklasvh/html2canvas" rel="nofollow noreferrer">html2canvas</a>. It returns the "screenshot" as base 64 encoded image which I then pass to my PHP server using AJAX. The server will then temporarily save the image at the file system, upload the image to Amazon S3 and then immediately delete the file. It works, but I would like to see if it is possible to upload the image directly without saving to file system.</p>
  
  <p>I know that there is a way to directly upload image through <a href="http://www.designedbyaturtle.co.uk/2013/direct-upload-to-s3-with-a-little-help-from-jquery/" rel="nofollow noreferrer">client side javascript</a>, but I don't want to enable CORS. Also, I have found <a href="https://stackoverflow.com/questions/7511321/uploading-base64-encoded-image-to-amazon-s3-via-node-js">a solution for Node.js</a>, so I guess there got to be a way to do it in PHP as well.</p>
  
  <p>I noticed that there are <a href="https://stackoverflow.com/questions/35890807/how-to-upload-base64-image-to-aws-s3-using-putobject">somebody asking similar question</a>, but there are no answer to that question, and the situation is a bit different, as I am using the <a href="https://github.com/aws/aws-sdk-php" rel="nofollow noreferrer">official PHP SDK</a> with <a href="https://github.com/aws/aws-sdk-php-laravel" rel="nofollow noreferrer">the official service provider for laravel</a></p>
  
  <p>So, is there a way I can directly upload a base64 encoded image to Amazon S3 without temporarily saving on file system?</p>