title: get image file object from url
body: <p>I am making a django-angularjs webapp.
  There is a option for file uploading for the users.
  <br><br>
  I want to provide users with some sample images to upload.<br>
  So it will be like the sample images will be sent by server to client and again send back to the server if the client chooses them as Fresh upload.
  <br></p>
  
  <p>angularjs directive:</p>
  
  <pre><code>angular.module('users').directive('fileModel', ['$parse', function ($parse) {
  return {
  restrict: 'A',
  link: function(scope, element, attrs) {
      var model = $parse(attrs.fileModel);
      var modelSetter = model.assign;
  
      element.bind('change', function(){
          scope.$apply(function(){
              modelSetter(scope, element[0].files[0]);
          });
      });
  }
  };
  }]);
  </code></pre>
  
  <p>my html:</p>
  
  <pre><code>&lt;input type="file" file-model="myFile"/&gt;&lt;br&gt;&lt;br&gt;
  &lt;button ng-click="uploadFile()"&gt;Upload&lt;/button&gt;
  </code></pre>
  
  <p>angular-js controller:</p>
  
  <pre><code>$scope.uploadFile = function(){
  
      var file = $scope.myFile;
      var uploadUrl = "/multer";
      var fd = new FormData();
      fd.append('file', file);
  
      $http.post(uploadUrl,fd, {
          transformRequest: angular.identity,
          headers: {'Content-Type': undefined}
      })
      .success(function(){
        console.log("success!!");
      })
      .error(function(){
        console.log("error!!");
      });
  };
  </code></pre>
  
  <p>Using the code above the user can select the image from their pc and upload them.<br></p>
  
  <p>Now if we have the url for the sample images sent by server.
  How to code the angular controller to get images for their file object from those urls?<br>
  like <b>$scope.myFile=getImageFileObjectFromUrl(url) ??</b></p>
  
  <p>thanks for help</p>