New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

loopback-component-storage-gridfs-in1t

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loopback-component-storage-gridfs-in1t

mrmartinimo loopback storage component gridfs with httprange support

  • 1.9.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

loopback-component-storage-gridfs-httprange

This repo is modification from https://github.com/MrMartiniMo/loopback-component-storage-gridfs

Uses mongoDB GridFS to manage binary contents of your loopback application.

Inspired by

Behaviors

  • Files are identified by id, not by file name. So it is possible to have files of the same name in one container.
  • Added HTTP Range feature
  • Added Bandwidth Limit feature via datasource options

Installation

npm install --save loopback-component-storage-gridfs-httprange

Datasource

Add datasource to your datasources.json

"storage": {
   "name": "gridfs",
   "connector": "loopback-component-storage-gridfs-httprange",
   "host": "hostname",
   "port": 27017,
   "database": "database",
   "username": "username",
   "password": "password",
   "limit" : 320000
 }

username and password are optional

Options

  • name : Datasource name
  • connector : loopback-component-storage-gridfs-httprange
  • host : MongoDB Hostname
  • port : MongoDB Port
  • database : MongoDB database name
  • username : MongoDB username
  • password : MongoDB password
  • limit : Bandwidth limit when downloading file, in bit

API

List containers

GET /FileContainers
FileContainer.getContainers();

Delete container

DELETE /FileContainers/:containerName
FileContainer.deleteContainer({
  containerName: 'containerName',
  fileId: 'fileId'
});
  • containerName - name of container to delete

List files in container

GET /FileContainers/:containerName/files
FileContainer.getFiles({
  containerName: 'containerName'
});
  • containerName - name of container

Get file information

GET /FileContainers/:containerName/files/:fileId
FileContainer.getFile({
  containerName: 'containerName',
  fileId: 'fileId'
});
  • containerName - name of container
  • fileId - id of file

Delete file

DELETE /FileContainers/:containerName/files/:fileId
FileContainer.deleteFile({
  containerName: 'containerName',
  fileId: 'fileId'
});
  • containerName - name of container
  • fileId - id of file to delete

Upload files

POST /FileContainers/:containerName/upload
  • containerName - name of container

Download file

GET /FileContainers/:containerName/download/:fileId
  • containerName - name of container
  • fileId - id of file to download

Keywords

FAQs

Package last updated on 05 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc