Skip to content

Instantly share code, notes, and snippets.

@ryohey
Created July 6, 2014 06:00
Show Gist options
  • Select an option

  • Save ryohey/cccc8fc25eb90d07cf87 to your computer and use it in GitHub Desktop.

Select an option

Save ryohey/cccc8fc25eb90d07cf87 to your computer and use it in GitHub Desktop.
node-multiparty-upload-example-app
express = require "express"
multiparty = require "multiparty"
app = express()
app.get "/", (req, res) ->
res.send """
<form action="/" enctype="multipart/form-data" method="post">
<input type="file" name="uploadFile">
<input type="submit">
</form>
"""
app.post "/", (req, res) ->
form = new multiparty.Form()
form.parse req, (err, fields, files) ->
console.log err, fields, files
res.send 200
app.listen 3000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment