I am using angular-file-upload directive for uploading a file in my application. And also I want to send some form data in JSON format along with the file. Using this configuration for uploading.
Upload.upload({
url: "https://angular-file-upload-cors-srv.appspot.com/upload",
fields: $scope.conf,
sendObjectsAsJsonBlob: true,
file: $scope.conf.file
});
But the problem is the values that are passed along with the file are in format
Headers:
[{fieldName: "accessKeyId", value: "1111"},
{fieldName: "accessKey", value: "aaaa"}]
And I want it in form of:
{"accessKeyId": "1111", "accessKey": "aaaa"}
Please tell me the configuration I required to pass for this format.