Skip to content

Instantly share code, notes, and snippets.

@mikekunze
Created August 5, 2013 13:45
Show Gist options
  • Save mikekunze/6156025 to your computer and use it in GitHub Desktop.
Save mikekunze/6156025 to your computer and use it in GitHub Desktop.
mUpload = (req, res)->
file = req.files["fileForm"]
tmpPath = file.path
fileName = file.name
dest = __dirname + "/#{fileName}"
fs.readFile tmpPath, (err, data)->
fs.writeFile dest, data, (err)->
if err
console.log err
res.end({success: true})
module.exports = mUpload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment