This repository is a Spring Guide tutorial demonstrating how to build a Spring Boot web application that accepts HTTP multipart file uploads. It contains four project variants: initial and complete versions in both Java and Kotlin, each with Maven and Gradle build files. The complete version adds a FileUploadController with endpoints for listing uploaded files, serving them as downloads, and handling uploads, plus a StorageService abstraction backed by a FileSystemStorageService that writes files to a configurable local directory (default 'upload-dir'). A Thymeleaf template provides a simple HTML upload form. The application is a small monolith: Spring MVC controllers handle GET / (list files), POST / (store uploaded file), and GET /files/{filename} (download with Content-Disposition). The storage layer uses java.nio.file APIs and includes a path traversal protection check that rejects filenames escaping the root directory. Upload size limits are configured via spring.servlet.multipart properties. Tests cover controller behavior with MockMvc, storage service security cases, and full integration tests using RestTestClient with redirect handling. This is educational sample code, not a production service. It demonstrates clean separation between web layer and storage abstraction, and the complete version includes meaningful security and testing patterns that can be reused in real projects. The code is actively maintained, uses current Spring Boot 4.0.x and Java 17, and is well-suited as a reference for implementing file upload endpoints.
This is a Preact single-page application that provides a user interface for uploading files to a backend API (DirectLink) that returns direct download links. The frontend handles file selection via drag-and-drop or file input, uploads with progress tracking, and maintains a history of uploaded files stored in localStorage. It uses valtio for reactive state management, Material UI and styled-components for styling, and axios for HTTP requests with retry logic. The application is cleanly structured with reusable custom hooks (useUnmountEffect, useProxyState) and a portal-based dialog system (DialogContainer). The backend is a separate binary not included in this repository. The codebase demonstrates modern frontend engineering with good separation of concerns and moderate complexity.