title: how to create a temp file from a base64 string
body: <p>im trying to upload an image (base64 string) gotten from a canvas element using javascripts .toDataURL() method:</p>
  
  <pre><code>var cropped_base64 = $crop_canvas[0].toDataURL('image/jpeg');
  cropped_base64 = cropped_base64.replace('data:image/jpeg;base64,','');
  
  $.ajax({
      url:the_url,
      data:{
          base64_string: cropped_base64
      },
      type:'POST',
      success:function(data){
          console.log(data)
      },
      error:function(data){
          console.log(data)
      }
  });
  </code></pre>
  
  <p>and my server side code decodes it:</p>
  
  <pre><code>my $base64_string = param('base64_string')
      or return 'error no base 64';
  
  my $image_decoded = MIME::Base64::decode_base64($base64_string)
      or return 'error couldnt decode base64';
  </code></pre>
  
  <p>I need this image as a temporary file, to pass to another routine.</p>
  
  <p>how can I generate this? I cant install modules like Image::magick...</p>