Skip to content

sasteswapnali-tech/google-drive-upload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📁 Google Drive Video Upload using Spring Boot

A Spring Boot REST API that uploads video files from a local machine directly to Google Drive using the Google Drive API and OAuth 2.0 Authentication.

🚀 Features

  • Upload videos to Google Drive
  • OAuth 2.0 Authentication
  • Multipart file upload
  • Returns Google Drive file link
  • REST API with Spring Boot
  • Tested using Postman

🛠️ Tech Stack

  • Java 21
  • Spring Boot 3
  • Maven
  • Google Drive API
  • Google OAuth 2.0
  • Postman

📂 Project Structure

src ├── controller ├── dto ├── exception ├── service ├── serviceImpl └── resources

📌 API Endpoint

POST

/api/drive/upload

Request

  • Content-Type: multipart/form-data
  • Parameter: file

✅ Sample Response

json { "success": true, "message": "Video Uploaded Successfully", "fileName": "sample.mp4", "driveLink": "https://drive.google.com/file/d/xxxxx/view" }

⚙️ Configuration

Place your credentials.json inside:

src/main/resources/

Configure:

properties server.port=8080 google.drive.folder-id=YOUR_FOLDER_ID

▶️ Run the Project

git clone https://github.com/your-username/GoogleDriveUpload.git
cd GoogleDriveUpload
mvn spring-boot:run

## 🧪 Test Using Postman

POST http://localhost:8080/api/drive/upload

Choose **Body → form-data**, add a key named **file** (type **File**), select a video, and click **Send**.

## 📚 Concepts Covered

- Spring Boot REST API
- Google Drive API Integration
- OAuth 2.0 Authentication
- Multipart File Upload
- Exception Handling
- DTO & Service Layer

About

Java Spring Boot application for uploading files to Google Drive using the Google Drive API.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages