Skip to content

Instantly share code, notes, and snippets.

@tetrashine
Last active August 23, 2020 07:44
Show Gist options
  • Save tetrashine/fe8d6a545db6618c8b9ec62ee89d02a4 to your computer and use it in GitHub Desktop.
Save tetrashine/fe8d6a545db6618c8b9ec62ee89d02a4 to your computer and use it in GitHub Desktop.
multer fileupload part 1
const express = require('express');
const app = express();
const port = 8080;
app.use('/', express.static('public'));
app.listen(port, () => console.log(`Running aserver listing on port ${port}...`));
<form method="POST" action="/file-upload" enctype="multipart/form-data">
<div>
<h3>Select your file:</h3>
<input type="file" name="uploaded_file" />
</div>
<div>
<input type="submit" name="uploadBtn" value="Upload" />
</div>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment