Skip to content

Error when boolean value is sent to multipart/form-data upload #1693

@sahilsk

Description

@sahilsk

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions