Loopback Download File

I follow the document to download the file.

https://docs.strongloop.com/display/public/LB/Storage+component

In this document, if downloading a file means you need to follow the url pattern.

GET / containers / {container} / files / {file}

Example:

I have container1 (container name) and lb.png file name.

So, I made a URL like

http://localhost:3000/api/containers/container1/files/lb.png?access_token=8Hfay0LRU2g22BjCqf3q8HsQCdsVBgBp9MHeekr3LfNLlILVUzUHUsUKOZmjTRD9 

I get an answer for the file name, I expect that when I use the url in the browser, the file should be loaded in the URL.

Answer:

 { "container": "container1", "name": "lb.png", "size": 38780, "atime": "2016-03-18T05:13:41.000Z", "mtime": "2016-03-18T05:09:06.000Z", "ctime": "2016-03-18T05:09:06.000Z" } 

Expected Result:

I need to upload a file (lb.png).

+5
source share
1 answer

No, the document says:

Get information for the specified file in the specified container.
getFile (container, file, cb)
GET / api / container /: container / files /: file

You need to use this route:

Upload the file to the specified container.
download (container, file, res, cb)
GET / api / container /: container / download /: file

+1
source

Source: https://habr.com/ru/post/1245284/


All Articles