0
votes

I try to build a server by loopback, which can upload and download files. But when I was reading docs, I followed its steps, but couldn't understand some descriptions. Storage component REST API. I can't understand "Arguments Container specification in POST body." Then fail in uploading and downloading. I'm not familiar with javascript and start learning node.js for only one week.

1
Welcome to Stack Overflow have a look at this How to create a Minimal, Complete, and Verifiable example. Please update your question with some code and show us what you have tried then we will be able to help. It seems you may have more than one question here so focus on one area and post further questions on the other areas - Dennington-bear

1 Answers

1
votes

http://loopback.io/doc/en/lb2/Storage-component.html

follow this docs. Here container is the folder name. After Following the steps in the docs then create a folder inside server called storage and create a model named container using slc cli. Then check it from explore you can see the file handling routes inside container section of the explorer. Use the below code to configure the model inside datasource.json

"imagestorage": {
"name": "imagestorage",
"connector": "loopback-component-storage",
"provider": "filesystem",
"root": "./server/storage"

}

cannot forget to specify your on location in root