title: Rename a file which comes from a copy/paste (on server side or front side)
body: <p>In a textarea, people can paste pictures. I handle that with AngularJS, the <code>ng-paste</code> directive and this piece of code</p>
  
  <pre><code>ctrl.handlePaste = function(event) {
      if(event.clipboardData.items.length &gt; 0) {
          for(var i = 0; i &lt; event.clipboardData.items.length; i++) {
              var item = event.clipboardData.items[i]; // type: DataTransferItem
              if (item.type.indexOf("image") != -1) {
                  file = item.getAsFile(); // type: File
                  // it's then stored in a array and will be sent to the server
                  break;
              }
          }
      }
  }
  </code></pre>
  
  <p>Then I send it to my Flask server (Python 2.7) and it is then sent by emails or pushed via API to another service.</p>
  
  <p>On server side I've checked the type and it's a Flask <code>FileStorage</code>.</p>
  
  <p>My problem is: this file is automatically named "image.png" (I'm using Chrome) and I cant find a way to change this name during the process.</p>
  
  <p>I'm ok with changing it on front side (my favourite option), I'm ok on server side too.</p>