0

I have a requirement where user will create a file first then I will start logging data into that file, How can i prompt window so user can browse to local directory and save file with their choice of location ?

Any angular way of implementing this ?

main.html

<button type="button" class="btn btn-success" ng-click="recordLogs()">record</button>

ctrl.js

$scope.recordLogs = function(){
        window.open("C:///");
    }
7
  • 1
    I am not sure you can gain access to the local file system as it would be considered a security risk (think of hackers making a user click on a button - hyperlink or image or whatever - and then it writes some file to their computer)... I could be wrong tho' Commented Jul 18, 2016 at 20:41
  • Are you in the browser, or is this a desktop application running on something like Electron? If you're in the browser, you don't have any file system access. Commented Jul 18, 2016 at 20:43
  • Possible duplicate of Read/write to file using jQuery Commented Jul 18, 2016 at 20:43
  • its internal web application user has to go through authentication to access this url Commented Jul 18, 2016 at 20:43
  • Write file on server or use database Commented Jul 18, 2016 at 20:45

1 Answer 1

2

Not possible, The client does not have access to the file system. You could however do something like this on the server and then output the files as downloads to the client.

If the application is internal then maybe the server/farm it lives in has network access to the users system in which case you could save and update the files accordingly over ssh etc.

The users system will need to have known credentials for access, Active Directory, system admin account, etc.

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.