File storage component on loopback4 #7283
-
Hi people, could somebody help my ?? please. !!! Becouse the connector to database is working OK, Regards |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
@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 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 use them in the upload/download controller also. |
Beta Was this translation helpful? Give feedback.
-
@marioestradarosa This controller is connected with a datasource, because I make a query, and it returns data where is the file. The build the path, is for windows, I think for linux, I shoud change samething.
|
Beta Was this translation helpful? Give feedback.
@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…