File upload
An endpoint is already available for file upload. it is /api/upload/default and it accepts any file. you can see it in your app configuration
app:
upload-configuration:
upload-options:
default:
upload-path: /uploads
server-path: G:\Workspace\Ibonia\FicheListe\uploads\uploads
allowed-types: '*'
max-size: 2000000
overwrite: true
If you want to add or change another configuration, you can just add a new upload option and a new end-point will be available.
app:
upload-configuration:
upload-options:
default:
upload-path: /uploads
server-path: G:\Workspace\Ibonia\FicheListe\uploads\uploads
allowed-types: '*'
max-size: 2000000
overwrite: true
images:
upload-path: /images
server-path: G:\Workspace\Ibonia\FicheListe\uploads\images
allowed-types: 'png|jpeg'
max-size: 2000000
overwrite: true
In this case, two endpoints will be available,
- /api/upload/default
- /api/upload/images
Upload option
| Option | Description |
|---|---|
| upload-path | this is how the user will access the uploaded file |
| server-path | the path where we store the uploaded files (it should end with upload-path) |
| allowed-types | file types allowed Pipe separated values |
| max-size | Maximum size of the file |
| overwrite | If true and two files happens to have the same name, the other one will be overwritten. |