javascript - Not able to upload file using Angular JS $http Post -


my form data is:

 var fd = new formdata();  //take first selected file  fd.append("file", document.getelementbyid('file').files[0], "abc"); 

my api request is:

var config = {             withcredentials : false,             transformrequest : angular.identity,             headers : {                 'content-type': undefined             }         } return $http.post(url, fd, config) 

at backend i'm still not getting object in params.

let me know why i'm not getting form data @ backend.


Comments

Popular posts from this blog

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

arrays - Algorithm to find ideal starting spot in a circle -