How to upload a file using loopback api explorer?

I am using Api Explorer loopback I need to upload a file, exploring how I can upload it because I cannot find any option to upload the file, please refer to the screenshot

enter image description here .

+5
source share
3 answers

Simply put, the answer is that you cannot. Downloading a file requires data from several parts. This is currently not possible through loopback-component-explorer. You should check out loobpack-component-storage . Here is an example; I recommend using example-2.0 .

+3
source

You can check it with POSTMAN .

But you only need the path to the file, not the file.

+1
source

Easier than using Postman would use curl direct on the terminal:

Here is the command that I use when necessary (I work with some services using loopback / explorer):

curl -i -X POST -H "Content-Type: multipart/form-data" -F " blob=@ /path/to/your/file.jpg" -v http://HOST:PORT/pathToYourEndpoint?access_token=xxxxxxxxxxx

0
source

All Articles