{"action":"created","issue":{"url":"https://api.github.com/repos/richardgirges/express-fileupload/issues/75","repository_url":"https://api.github.com/repos/richardgirges/express-fileupload","labels_url":"https://api.github.com/repos/richardgirges/express-fileupload/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/richardgirges/express-fileupload/issues/75/comments","events_url":"https://api.github.com/repos/richardgirges/express-fileupload/issues/75/events","html_url":"https://github.com/richardgirges/express-fileupload/issues/75","id":303574419,"number":75,"title":"Upload Image and other params at the same action save.","user":{"login":"thanhthein","id":29219787,"avatar_url":"https://avatars0.githubusercontent.com/u/29219787?v=4","gravatar_id":"","url":"https://api.github.com/users/thanhthein","html_url":"https://github.com/thanhthein","followers_url":"https://api.github.com/users/thanhthein/followers","following_url":"https://api.github.com/users/thanhthein/following{/other_user}","gists_url":"https://api.github.com/users/thanhthein/gists{/gist_id}","starred_url":"https://api.github.com/users/thanhthein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanhthein/subscriptions","organizations_url":"https://api.github.com/users/thanhthein/orgs","repos_url":"https://api.github.com/users/thanhthein/repos","events_url":"https://api.github.com/users/thanhthein/events{/privacy}","received_events_url":"https://api.github.com/users/thanhthein/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-08T17:58:47Z","updated_at":"2018-04-10T20:55:56Z","closed_at":null,"author_association":"NONE","body":"How can I upload Image Profile and save other infomation at only one Save button ?\r\nI tried to send with other Body but the response is bad request:\r\nMy code:\r\n````javascript\r\n      $.post(\"/film/\", {\r\n            filmName: $scope.filmName,\r\n            categoryName: $scope.filmGenre,\r\n            year: $scope.filmYear,\r\n            detail: $scope.filmContent\r\n            photoURL: photoURL\r\n        }, function (res) {\r\n            console.log(res);\r\n            if (res.code == 200) {\r\n                alert(res.message);\r\n                window.location.href = '/'\r\n            }\r\n        })\r\n````\r\n\r\n````javascript\r\nmodule.exports = (app) => {\r\n    let uploadController = require('../controllers/uploadController'),\r\n        config = require('../config/config').CONFIG_API,\r\n        fileUpload = require('express-fileupload');\r\n       app.use(fileUpload());\r\n    app.route('/upload')\r\n        .post(uploadController.uploadImage)\r\n}\r\n````\r\n\r\n\r\n````java\r\n\r\n    uploadRoute.uploadImage = (req, res) => {\r\n        console.log(req);\r\n        if (!req.files)\r\n            return res.status(400).send('No files were uploaded.');\r\n\r\n        // The name of the input field (i.e. \"sampleFile\") is used to retrieve the uploaded file\r\n        let fileInput = req.files.fileInput,\r\n            name = './pictures/' + (Date.now + 1)\r\n\r\n        // Use the mv() method to place the file somewhere on your server\r\n        fileInput.mv(name, function (err) {\r\n            if (err)\r\n                return res.status(500).send(err);\r\n            res.send('File uploaded!');\r\n        });\r\n        res.status(200).json({ name: name })\r\n    }\r\n````\r\n\r\n````java\r\n  $scope.uploadImage = function () {\r\n        console.log(\"UPload image start !\");\r\n        $.post('/upload', function (req, res) {\r\n            console.log(res);\r\n        });\r\n    }\r\n````\r\nIn my code, start upload image when user select to any input and type somethings. And I received iamgeURL from respone. But it did not work. \r\nBad request.\r\nSo, i'm waiting solution\r\n\r\n![image](https://user-images.githubusercontent.com/29219787/37167051-5ba14230-2333-11e8-8df3-b82c1dbf1283.png)\r\n"},"comment":{"url":"https://api.github.com/repos/richardgirges/express-fileupload/issues/comments/380243670","html_url":"https://github.com/richardgirges/express-fileupload/issues/75#issuecomment-380243670","issue_url":"https://api.github.com/repos/richardgirges/express-fileupload/issues/75","id":380243670,"user":{"login":"sant123","id":7959437,"avatar_url":"https://avatars3.githubusercontent.com/u/7959437?v=4","gravatar_id":"","url":"https://api.github.com/users/sant123","html_url":"https://github.com/sant123","followers_url":"https://api.github.com/users/sant123/followers","following_url":"https://api.github.com/users/sant123/following{/other_user}","gists_url":"https://api.github.com/users/sant123/gists{/gist_id}","starred_url":"https://api.github.com/users/sant123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sant123/subscriptions","organizations_url":"https://api.github.com/users/sant123/orgs","repos_url":"https://api.github.com/users/sant123/repos","events_url":"https://api.github.com/users/sant123/events{/privacy}","received_events_url":"https://api.github.com/users/sant123/received_events","type":"User","site_admin":false},"created_at":"2018-04-10T20:55:56Z","updated_at":"2018-04-10T20:55:56Z","author_association":"NONE","body":"req.body should have\r\n\r\n``` js\r\n{\"firstName\":\"Santi\",\"lastName\":\"Aguilar\"}\r\n``` "}}
{"actor":{"display_login":"sant123"}}