Skip to content
Discussion options

You must be logged in to vote

You are simply relying on the /public folder to serve images for you. As shared earlier in the discord, you should just write a 2 liner route to serve images from a custom directory.

  • I will store the files inside ../storage/uploads.
  • Then write the following route to server uploaded files.
    Route.get('uploads/:filename', async ({ response, params }) => {
      response.download(Application.makePath('../storage/uploads', params.filename))
    })
  • Finally access files by visiting /uploads/<filename>

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@LeadcodeDev
Comment options

@ericmp33
Comment options

Answer selected by LeadcodeDev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants