Skip to content

Latest commit

 

History

History

spring-fileserver

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Simple FileServer demo

This is simple spring-boot FileServer demo. This server makes specified base directory accessible via REST APIs allowing you to list, download, upload and delete files and create empty directories.

Rest Endpoints

All REST endpoints use 'dynamic' path. This means that path ** is used as relative path in base directory.

Upload files

  • POST http://localhost:8888/services/files/upload/** - upload file, parent directory(ies) must exist before upload
    curl -F 'file=@/local/path/to/file.txt' http://localhost:8888/services/files/upload/path/to/001-data.txt

Delete files and directories

Create empty directory

Build and run

Variable file.server.home in application.properties file defines base directory to be exposed via REST APIs.

gradle clean build
java -jar build/libs/springboot-fileserver-0.0.1-SNAPSHOT.jar --spring.config.location=file:./src/main/resources/application.properties