Skip to content

Gauravg2630/React-file-upload-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ React File Upload App with Progress Bar and Preview (Day 25 of #100DaysOfReact) This project is a fully functional React file upload application with image preview, upload progress bar, and backend integration using Express and Cloudinary for cloud image storage. The app allows users to select an image, preview it instantly, upload it to the backend, and view the uploaded image with a link to open the full version in a new tab.

πŸš€ Features Select and preview image before uploading Upload progress bar to track upload status Upload images to Cloudinary via Express backend Display uploaded image with clickable full image view Error handling for unsupported files and upload issues Clean and responsive UI

πŸ› οΈ Tech Stack Frontend: React, Axios, CSS Backend: Express, Multer, Cloudinary SDK Cloud Storage: Cloudinary Middleware: CORS

πŸ“ Folder Structure React-file-upload-app/ β”œβ”€β”€ backend/ β”‚ β”œβ”€β”€ node_modules/ β”‚ β”œβ”€β”€ index.js # Express server with upload API β”‚ β”œβ”€β”€ package.json β”‚ β”œβ”€β”€ .env # Cloudinary config secrets β”œβ”€β”€ frontend/ β”‚ β”œβ”€β”€ node_modules/ β”‚ β”œβ”€β”€ src/ β”‚ β”‚ β”œβ”€β”€ App.js # React file upload component β”‚ β”‚ β”œβ”€β”€ index.js β”‚ β”‚ β”œβ”€β”€ App.css β”‚ β”œβ”€β”€ package.json β”œβ”€β”€ README.md βš™οΈ Setup Instructions Backend

Navigate to backend folder cd backend

Install dependencies: npm install express cors multer cloudinary multer-storage-cloudinary dotenv

Create .env file in backend folder with Cloudinary credentials: CLOUDINARY_CLOUD_NAME=your_cloud_name CLOUDINARY_API_KEY=your_api_key CLOUDINARY_API_SECRET=your_api_secret

Start the backend server: node index.js

Frontend: Navigate to frontend folder: cd frontend

Install dependencies: npm install react axios

Start the React app: npm start

πŸ–ΌοΈ Demo:

Live LInk : https://react-file-upload-app-1.onrender.com/

Select an image file (jpg, jpeg, png, gif) Preview the selected image immediately Click Upload button to upload to backend/Cloudinary See upload progress bar update in real-time After success, view the uploaded image and open the full image in a new tab

πŸ“¬ Connect With Me: LinkedIn: https://www.linkedin.com/in/gorav-gumber-9319a2342/ GitHub: https://github.com/Gauravg2630 Email: goravgumberg@gmail.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published