0

I want to send my form(which will have file and name in it) using javascript to the server using http.post request but I am not able to fetch file in javascript. How will i do that i have file path. And i don't want to do this using input tag.

var Form = new FormData();
Form.append("file", file);//this file has to added using path of the file

$http.post(url, Form, {
    transformRequest: angular.identity,
    headers: { 'Content-Type': undefined }
})   
.success(function(d) {
    console.log("sucess" + d);
});
  • Possible duplicate of [How does HTTP file upload work?](http://stackoverflow.com/questions/8659808/how-does-http-file-upload-work) – Shailendra Sharma Nov 05 '15 at 07:47
  • Actually i am working on illustrator's extension using angularjs i want to send file to server on which i am currently working on illustrator i am able to get path of the file but how will i get the file.? – hemant chaudhary Nov 05 '15 at 11:21

0 Answers0