Posts

Showing posts with the label File Upload & Download Example

Spring Boot + Angular : File Upload, List, Download, and Delete Example

Image
To implement file upload, list, download, and delete functionality using Angular 19 for the frontend and Spring Boot 3 for the backend, follow these updated steps: 1. Backend: Spring Boot 3 Dependencies Add the required dependencies to your pom.xml file: < dependencies > <!-- Spring Boot Starter Web --> < dependency > < groupId > org.springframework.boot </ groupId > < artifactId > spring-boot-starter-web </ artifactId > </ dependency > <!-- File Upload and Apache Commons --> < dependency > < groupId > commons-io </ groupId > < artifactId > commons-io </ artifactId > </ dependency > </ dependencies > File Controller Create a FileController that handles file upload, list, download, and delete operations: import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework....

Google Cloud Storage (GCS) + Django - File Upload, Download, List, and Delete Example

Image
To integrate Google Cloud Storage (GCS) with a Django application for file upload, download, list, and delete operations , follow these steps: 1. Set Up Google Cloud Storage Create a Google Cloud Project : Visit the Google Cloud Console and create a new project or use an existing one. Enable the Cloud Storage API : Navigate to APIs & Services > Library , search for "Cloud Storage," and enable it. Create a GCS Bucket : Go to Storage > Browser in the console. Click Create Bucket , choose a globally unique name, configure settings, and create it. Set Up a Service Account : Go to IAM & Admin > Service Accounts , create a service account, and assign the Storage Admin role. Generate a key (JSON) for the service account and download it to your local machine. 2. Configure Django for GCS Install Required Libraries : Install the Google Cloud Storage and Django libraries: pip install google-cloud- storage django-storages Set Up the Django Storage Backend : Add th...

Google Cloud Storage + Spring Boot - File Upload, Download, and Delete

Image
In this section, we will learn  how to  create a simple spring boot application to perform different file operations such as upload, download, list, and delete files from the Google Cloud Storage. 1.  A little bit of Background Google Cloud Storage Cloud Storage is a managed service for storing unstructured data. Store any amount of data and retrieve it as often as you like. More Info - click here! Spring Boot Spring Boot makes it easy to create stand-alone, production-grade Spring-based Applications that you can "just run".  More Info - click here! 2. Create a GCP Project First, Sign into the Google console at  https://console.cloud.google.com . You can create a new project by first selecting the project dropdown in the top left and selecting " New Project ". Next, specify your GCP  Project name  and  Project ID . Then  Click on the " CREATE " button. Copy " Project ID " and keep it for future purposes. 3. Create a Google Cloud Storage bucke...