Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loopback Download file

I am following the document for download the file.

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

In that document if download the file means need to follow the url pattern.

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

Example:

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

So I maked the url like this

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

I am getting the response for file name, I expect once I use the url in browser means the file should be download into the url.

The response getting:

{
  "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 Output:

I need to download the file(lb.png).

like image 591
RSKMR Avatar asked Nov 08 '22 18:11

RSKMR


1 Answers

No, the doc says:

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

You need to use this route:

Download a file within specified container.
download(container, file, res, cb)
GET /api/containers/:container/download/:file

like image 150
Shanoor Avatar answered Nov 15 '22 06:11

Shanoor