title: creating an image file object from an image web url
body: <p>I would like to take an image's URL and use that to get the image file object and send it to my server. i have looked around and have gotten this far but the code does not work properly. When i send it to my server it does not upload as an image file but simply uploads as a file without the .JPG extension or any image file extension.</p>
  
  <pre><code>    var byteNumbers = new Array(this.imgUrl.length);
  
      for (var i = 0; i &lt; this.imgUrl.length; i++)
      {
          byteNumbers[i] = this.imgUrl.charCodeAt(i);
      }
  
      this.img = new File(byteNumbers, "imgFromUrl", { type: "image/jpeg" });  
  </code></pre>
  
  <p>This gets the file and shows me the file details on my log such as lastmodified, filename and such. but when i upload it to my server i just get a file with no extension as mentioned above.</p>
  
  <p>The file is being uploaded by being attached to a form and sent to the server.This is because i'm sending other data as well.</p>
  
  <pre><code>this.http.post(this.serverUrl + "face/detect/", data, { headers: this.headers })
            .toPromise()
            .then(response =&gt; response.json())
            .catch(error =&gt; error);
  </code></pre>