2

I am trying to develop a simple web application using mean stack. I want to take a file input from the user and save the uploaded file into a folder(Ex: /home/user/Desktop/files). Can someone please help me on how to write the controller to do this.

My ui code is as follows.

      <h5>Upload file</h5>
      <div class="input-group">
         <span class="input-group-btn">
           <span class="btn btn-primary btn-file">
             Browse&hellip; <input type="file" multiple>
           </span>
         </span>
         <input type="text" id="file" class="form-control">
      </div>

     <button type="submit" class="btn btn-primary btn-sm">Submit</button>  

It looks like this.

enter image description here

When the user uploads the file. I want the file to appear in the input field will file id and when he clicks on the submit button the file should get saved in the given folder.

Minions
  • 1,273
  • 1
  • 11
  • 28
  • Possible duplicate of [File Upload using AngularJS](http://stackoverflow.com/questions/18571001/file-upload-using-angularjs) – youngrrrr Apr 07 '16 at 13:57
  • The main thing that I want to achieve is displaying the name of the file in the input element with file id. I also want to save the file locally into a particular folder. – Minions Apr 07 '16 at 17:13
  • ah sorry, my mistake. I missed the subtlety of your question. – youngrrrr Apr 07 '16 at 17:58

0 Answers0