loopback-example-database icon indicating copy to clipboard operation
loopback-example-database copied to clipboard

Cannot Get specific file from s3 using Strongloop

Open nargiskhatoon opened this issue 10 years ago • 4 comments

Hi @superkhau I can upload, delete and get list of containers from (s3) but not able to get specific file(path: Mycontainer/folder1/folder2/myFile) from amazon S3 using Strongloop. I am using loopback-datasource-juggler": "^2.7.0. Thanks in advance

My code

$scope.getS3Files = function(myFile){ //have to get all zip files in folder2
  $http.get('api/basePath/containerABC/files/folder1/folder2/' + myFile).then(function (result) {
      $scope.filePath = result.data;
    }, function (err) {
      toastr.error(err.data.error.message);
    }),
  }; 

datasources.json

"dsS3": {
    "name": "dsS3",
    "connector": "loopback-component-storage",
    "provider": "amazon",
    "key": "keyabc",
    "keyId": "keyIdabc"
  },

Error:

message: "Shared class "basePath" has no method handling GET /containerABC/files/folder1/folder2/myFile"
name: "Error"
stack: "Error: Shared class "basePath" has no method handling GET /containerABC/files/folder1/folder2/myFile↵    at restRemoteMethodNotFound (d:\NodeJSProjects\abc\node_modules\loopback\node_modules\strong-remoting\lib\rest-adapter.js:322:17)↵    at Layer.handle [as handle_request] (d:\NodeJSProjects\abc\node_modules\loopback\node_modules\express\lib\router\layer.js:95:5)↵    at trim_prefix (d:\NodeJSProjects\abc\node_modules\loopback\node_modules\express\lib\router\index.js:312:13)↵    at d:\NodeJSProjects\abc\node_modules\loopback\node_modules\express\lib\router\index.js:280:7↵    at Function.process_params (d:\NodeJSProjects\abc\node_modules\loopback\node_modules\express\lib\router\index.js:330:12)↵    at next (d:\NodeJSProjects\abodeadmin\node_modules\loopback\node_modules\express\lib\router\index.js:271:10)↵    at Function.handle (d:\NodeJSProjects\abc\node_modules\loopback\node_modules\express\lib\router\index.js:176:3)↵    at router (d:\NodeJSProjects\abc\node_modules\loopback\node_modules\express\lib\router\index.js:46:12)↵    at Layer.handle [as handle_request] (d:\NodeJSProjects\abc\node_modules\loopback\node_modules\express\lib\router\layer.js:95:5)↵    at trim_prefix (d:\NodeJSProjects\abc\node_modules\loopback\node_modules\express\lib\router\index.js:312:13)"
status: 404
statusCode: 404

nargiskhatoon avatar Mar 15 '16 05:03 nargiskhatoon

Can you provide a sample repo so we can reproduce this issue on our end?

@Amir-61 Can you take care of this? Ping me if you need help.

superkhau avatar Mar 15 '16 07:03 superkhau

Sure

Amir-61 avatar Mar 15 '16 23:03 Amir-61

@superkhau actually Its not working for "/" .Like /Mycontainer/files/folder1/folder2**/**myFile1 //file in folders.

Its working for '/Mycontainer/files/myFile2'.// no folder

nargiskhatoon avatar Mar 16 '16 08:03 nargiskhatoon

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

stale[bot] avatar Sep 06 '17 15:09 stale[bot]