Skip to content

File storage component on loopback4 #7283

Answered by marioestradarosa
emazzu asked this question in Q&A
Discussion options

You must be logged in to vote

@emazzu , the example shows how to provide upload/download. Multer is used as the storage, but keep in mind that this storage is a folder in your file system. At the end of application.ts file you can find the multer options. However, the dataSource as per a database connection is up to you, this example shows how to manage the appropriate upload/download of a file and served from a loopback 4 server.

additionally you can have a database table that associates the file name to a record but that s another standard step in loopback 4 using the concept of datasource/models/repository. Keep in mind that these 3 artifacts don't necessarily will have to have a controller, in this case you can us…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@emazzu
Comment options

@marioestradarosa
Comment options

@emazzu
Comment options

Answer selected by marioestradarosa
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants