This project is a simple file uploader using Node.js, Express, and Multer. It allows users to upload files, with a focus on images, and stores them on the server. The frontend is built using HTML, CSS, and JavaScript with responsive and user-friendly features.
- Upload files via an HTML form.
- Uses Multer for handling file uploads in Node.js.
- Responsive UI with feedback on file selection and upload status.
- Separate
CSS
for styling andJavaScript
for form handling. - File validation and form submission feedback.
-
Clone this repository:
git clone https://github.com/your-username/file-uploader.git
-
Navigate to the project directory:
cd file-uploader
-
Install the dependencies:
npm install
-
Start the server:
npm start
-
Open a browser and go to:
http://localhost:3000
- On the homepage, click the "Choose File" button to select a file.
- Once a file is selected, its name will be displayed.
- Click "Upload" to upload the file to the server.
- After submission, a message will confirm whether the upload was successful.
- Node.js: JavaScript runtime for server-side development.
- Express.js: Web framework for handling routes and requests.
- Multer: Middleware for handling
multipart/form-data
, used for file uploads. - HTML/CSS/JavaScript: Frontend technologies for building the user interface.
- EJS: Embedded JavaScript templates for rendering dynamic views.
- To modify the CSS, edit the
styles.css
file in thepublic/css/
folder. - To add or modify JavaScript behavior, update the
script.js
file inpublic/js/
. - The server logic is located in
app.js
, which sets up the file upload route and handles storage using Multer.
Make sure the node_modules
folder and any environment-specific files are not pushed to your Git repository by using the provided .gitignore
file.