0

hi i am using angularjs image upload functionality once i upload the image . uploaded image will show img src tag after showing i need refresh the input type file but now image shows but that path still there i need refresh or delete the path after iamge show in thumbnail

code

<input id="fileMobile" type="file" ngf-select  ng-model="up.file" name="file" onchange="angular.element(this).scope().file_changed(this)"
   ngf-pattern="'image/*'" accept="image/*" ngf-max-size="4MB" />
 <img ng-src="rfile" style="width:80px;" ng-show="!!up.file" ngf-thumbnail="up.file " />

http://jsfiddle.net/824Ldzd8/4/

after image show i want remove the filename in file upload

1

1 Answer 1

0

[OdeToCode posted great service] http://odetocode.com/blogs/scott/archive/2013/07/03/building-a-filereader-service-for-angularjs-the-service.aspx for this stuff. So with this simple directive you can easily preview and even see the progress bar:

.directive("ngFileSelect",function(){    
  return {
    link: function($scope,el){          
      el.bind("change", function(e){          
        $scope.file = (e.srcElement || e.target).files[0];
        $scope.getFile();
      });          
    }        
  }

Here is the Example: http://plnkr.co/edit/y5n16v?p=preview

Sign up to request clarification or add additional context in comments.

1 Comment

chk my fiddle @Narendra Solanki

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.