Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

I'm using lib angular-file-upload.

How do I add the date field of $http request on request below:

var app = angular.module('app', ['angularFileUpload']);

app.controller('Aula21Controller', function($scope, FileUploader){

    var uploader = $scope.uploader = new FileUploader({
        url : 'http://localhost:8080/work/v1/chats',
        alias: 'message-body',
        headers: {'X-Client-Instance': '1.221@0000010000083359', 'Content-Type': 'multipart/formdata'},    
    });

In my request needs to send a json object (date field) with the items below:

json object - data 

{
    "receiver":"", 
    "localAddress":"", // ip 
    "attachment":"", // name file
    "content":"" // content message
}

Thanks.

share|improve this question
up vote 0 down vote accepted

Assuming you're using this lib: https://github.com/nervgh/angular-file-upload/, you can pass additional data using the formData property

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.