javascript - sails:Can't able to get textbox value while submitting a form with enctype="multipart/form-data" -


i'm doing file upload in sails.js facing issue while submitting form enctype="multipart/form-data".

my file.ejs

<form id="uploadform" enctype="multipart/form-data" action="/employee/upload"       method="post">         <input type="file" name="uploadfile" />          <input type="text" name="name" />          <input type="submit" value="submit"/> </form> 

my controller

upload: function  (req, res) {           var username =req.param("name");         console.log(username);          var uploadfile = req.file('uploadfile');         console.log(uploadfile);          uploadfile.upload(function onuploadcomplete (err, files) {                             if (err) return res.servererror(err);                                            console.log(files);              res.json({status:200,file:files});         });     } 

i'm going create function in same upload function storing file name , username databasetable.but req.param("name") shows undefined.how can texbox value form.

i'm new sails.js.so please give suggestions or sollutions bug.it usefull me.


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -