This is a simple file server that allows uploading and downloading files.
- Upload files via a web form
- View uploaded image and PDF files directly in the browser
- Download uploaded files
- List all uploaded files
- Clone the repository
- create a folder
views
then mooveindex.ejs
into the fodler - Run
npm install
to install dependencies - Run
node index.js
to start the server - Open
http://localhost:3000
in your browser
The main dependencies are:
express
- web frameworkmulter
- for handling file uploadsejs
- for rendering templates
The index.js file:
- Sets up the Express app and configures EJS as the template engine
- Configures Multer for handling file uploads
- Renders the main page with a list of uploaded files
- Handles requests for downloading and uploading files
The templates/index.ejs file:
- Displays the upload form and list of uploaded files
- Shows uploaded images and PDFs directly in the page
The public/uploads folder is where the uploaded files are saved.