I'm using loopback Api Explorer I need to upload a file by explore how can I upload that because I don't find any option to upload file please refer the screenshot
.
Simply put, the answer is that you can't. Uploading a file requires multi-part form data. This isn't currently possible via the loopback-component-explorer. You should checkout the loobpack-component-storage instead. There is an example here; I recommend using the example-2.0
.
You can test it with something like POSTMAN.
But, the only that you need, is the path of the file, not the file.
Simpler than using Postman would be using curl direct on the terminal :
Here is the command I use when need(I work with some services using loopback/explorer as well) :
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With