title: KeystoneJS edit file before AmazonS3 Upload
body: <p>How do I edit the KeystoneJS file before it is uploaded to AmazonS3</p>
  
  <p>It sounds like I should be able use an underscore method... but I don't know how to implement it
  <a href="https://i.stack.imgur.com/Cgecn.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Cgecn.jpg" alt="enter image description here"></a></p>
  
  <p>So for example, lets say I want to convert the file to base64 before it is uploaded to S3 and it is done with a function. How do I get the file, apply functions or methods to it, and then upload it.</p>
  
  <pre><code>Model.add({
      file: {         
          type: Types.S3File,
          filename: function(item, filename, originalname){                       
              return "fonts/original/" + item.slug + '.file';
          },
  
          // ** // ** // ** // ** // ** // ** 
          // Seems like it should go here...
          // On upload EVENT convert file to base64 and upload to S3
          // ** // ** // ** // ** // ** // ** 
  
      }
  });
  </code></pre>