Last active
August 23, 2020 07:44
-
-
Save tetrashine/fe8d6a545db6618c8b9ec62ee89d02a4 to your computer and use it in GitHub Desktop.
multer fileupload part 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}...`)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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