javascript - AngularJS: Get path to file from input tag -
using this solution i'm able retrieve files input
tag in base64 encoding via directive:
.directive("fileread", [function () { return { scope: { fileread: "=" }, link: function (scope, element, attributes) { element.bind("change", function (changeevent) { var reader = new filereader(); reader.onload = function (loadevent) { scope.$apply(function () { scope.fileread = loadevent.target.result; }); }; reader.readasdataurl(changeevent.target.files[0]); }); } } }])
the readasdataurl
read file base64.
how possible path selected file input
tag? e.g. file:///....
Comments
Post a Comment