-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Closed
Description
Hi,
I tried different combination for uploading image with form fields. I can only get either of them working. If i remove all fields leaving image only , then my request upload files successfully. If i put fields along with image, like i did below, it doesn't work.
I tried different combination. None worked for me.
At server side i'm using mutler with expressjs.
Any help here would be great.
var formParam = {
title: "testing single image"
, caption: "Caption of image to test"
, tags:"spa, saloon"
, trademark: "la saloon trademark"
, is_cover_photo: false
, image: fs.createReadStream(__dirname + '/fixtures/images/services/SpaSalon.jpg')
};
var r = request({
// preambleCRLF: true
// , postambleCRLF: true
method: 'POST'
, url: "/services/" + serviceFix.id + "/photos"
// , body: formParam
, formData: formParam
, json: true
}, function(err, res, body){
console.log("body ", body);
expect( body.errors.length ).to.be(0);
expect(res.statusCode).to.be(200);
serviceFix.photos.push(body.data);
done();
});Metadata
Metadata
Assignees
Labels
No labels