0

I am not able to get proper file path,

i want to add file path into my database,

i did this with c#, but now i am using angularjs,

here is my html page

<a href="#" ID="btn">ssss</a>
<input type="file"/>

here is my jquery page

$(function () {
    $('#btn').click(function () {
        alert($('input[type=file]').val());
        return false;

    });
});

and i tried to do this with angular and javascript, but not succeeded in any of them,

i google about this an come to know it is not possible in client side, but i uploaded the filepath using directive in angularjs, but i am not able to get the code,

what i need to do, i want to upload the filepath into database

  • 3
    As you've discovered, it's not possible to get the client side path of the file due to security restrictions in the browser. If you want the server side path, it's wherever you saved the file. – Rory McCrossan Feb 08 '17 at 10:18
  • actually i did it by using directive but i am not able to pick up that –  Feb 08 '17 at 10:26
  • Maybe this can help you http://stackoverflow.com/questions/17063000/ng-model-for-input-type-file – stackg91 Feb 08 '17 at 10:33
  • i tried that not helping me, but can you answer this? –  Feb 08 '17 at 10:46

0 Answers0