Spring Community uses local filesystem storage for all uploaded images. Two categories of images are managed: event banners uploaded when creating or editing an event, and participant profile pictures uploaded by users. Each category lives in its own subdirectory under a single configurable root location, making it straightforward to back up, replace, or mount as a Docker volume.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/CristianRR94/springCommunity/llms.txt
Use this file to discover all available pages before exploring further.
Storage Layout
At startup the application expects the storage root (default:images) to exist and be writable. Inside that root, two subdirectories hold the respective image types. Each subdirectory ships with a default.png that is used when no image has been uploaded yet.
The
default.png files must exist before the application receives its first request for a missing image. Include them in your repository or container image so they are always present.Configuration
The storage root is bound through theStorageProperties class, which reads the storage.location property using Spring Boot’s @ConfigurationProperties mechanism:
StorageConfig enables this binding by declaring @EnableConfigurationProperties(StorageProperties.class):
storage.location property in application.properties or via an environment variable:
ImageHandlerConfig:
Serving Images
Uploaded images are served as static resources by Spring MVC’s resource handler, configured inImageHandlerConfig. Any file inside the storage root is accessible at the /images/** URL path, which is declared as a public route in the security filter chain — no authentication token is required to retrieve an image.
Event banner
Stored at
images/eventos/<filename> and served atGET /images/eventos/<filename>Profile picture
Stored at
images/usuarios/<filename> and served atGET /images/usuarios/<filename>Upload Limits
Spring’s multipart support caps the size of individual files and entire requests. Both limits default to 5 MB and are configured inapplication.properties:
Uploading Images
Images are uploaded as parts of multipart HTTP requests. There are three endpoints that accept image uploads:Create an event with a banner — POST /api/eventos
Submit a Handled by
multipart/form-data request with two parts: evento (JSON body) and an optional image part. If image is omitted the event is created without a custom banner.EventoController:Update an event banner — PUT /api/eventos/modificar/{id}
Same multipart structure as creation. The Handled by
image part is optional; if omitted the existing banner is preserved.EventoController:Upload a participant profile picture — POST /api/participantes/imagen
Submit a Handled by
multipart/form-data request with a required image part. This endpoint is authenticated — a valid Bearer token must be present. The image is associated with the participant linked to the currently authenticated user.ParticipanteController:Docker Volume
In the Docker Compose setup the application container mounts the project root as/app, which means the images/ directory inside the repository is the live storage root. Uploaded images are written to your host machine and survive container restarts and rebuilds.
storage.location=images is relative to the working directory (/app), images are written to /app/images/ inside the container, which maps to ./images/ on the host.
The
storage.location value in StorageProperties must point to an existing, writable directory before the application starts. On Docker this is guaranteed by the volume mount above. When running locally, create the images/eventos/ and images/usuarios/ directories (and their default.png placeholders) before starting the application for the first time.