ios - Saving an image using node (fs writeStreams) inserts headers into file -
i trying upload photo (in multipart form) ios app, using afnetworking
. using node.js backend, , have working. problem when trying save image writing headers file...so of images save have in beginning (when open image in plain text):
--boundary+9ef923e9caacb213 content-disposition: form-data; name="para" val --boundary+9ef923e9caacb213 content-disposition: form-data; name="afimage"; filename="afimage.jpg" content-type: image/jpeg
the server code using is:
uploadios: (req, res) ->
tmpfile = variables.uploadsdir + "tempname" ws = fs.createwritestream(tmpfile) req.on 'data', (data) -> ws.write data req.on 'end', -> ws.end()
i can working using express body parser, prefer way if possible. ideas how strip away headers?
you have use multipart-capable parser such busboy or multiparty.
Comments
Post a Comment