Skip to content

How do we setup a spring boot application to handle uploaded files? #13

@zgulde

Description

@zgulde

We're assuming you have a spring boot application is setup to handle file
uploads, and the location that files are uploaded to are specified your
application.properties.

We'll also assume that you have set the site up already with the domain name
example.com.

  1. Create a folder for the uploaded files in your application

    myserver run mkdir -p /srv/example.com/public/uploads
    

    The directory can be named whatever you want, so long as it is inside the
    public for your site (i.e. /srv/example.com/public).

  2. Modify the application.properties file on the server:

    myserver run nano /srv/example.com/application.properties
    

    Add the file upload path (i.e. the path to the directory you created in the
    last step) to the application.properties file

    ...
    file-upload-path = /srv/example.com/public/uploads
    ...
    
  3. Re-build your application so that it uses the updated application.properties

    myserver site build --domain example.com
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsNeeds more documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions