1

I am sending a fromfields as formdata()

var data1 = new FormData();
    data1.append('input_file_name', $('#fileName').prop('files')[0]);
    data1.append('input_image_name', $('#imageName').prop('files')[0]);
    if($scope.fileName!="" && $scope.imageName!="")
    {

        $http({
            url: '/upload',
            method: "POST",
            data: data1
        })
        .then(function(response) {
                console.log("success")
        }, 
        function(response) { // optional
                console.log("failed")
        }); 
    } 

on the server side how to read this formdata values sent form HttpRequest.

 app.post('/upload',function(req,res)
 {
     console.log(req.files.file.path)
 })

How to read the path of files.

bharath
  • 845
  • 2
  • 11
  • 23
  • What path? The one from the system that uploaded it? [You can't](http://stackoverflow.com/questions/81180/how-to-get-the-file-path-from-html-input-form-in-firefox-3) – Quentin Aug 05 '15 at 07:56
  • i want to do simple file upload program. i have two input file type in program. on button click i want to upload the files selected in browse fileds. How to do this ... – bharath Aug 05 '15 at 08:01
  • @bharath https://github.com/expressjs/multer – stdob-- Aug 05 '15 at 08:16

0 Answers0