Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

koa-file-upload-all-in-one

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-file-upload-all-in-one

koa middleware use upload file

latest
npmnpm
Version
1.0.1
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
Source

koa-file-upload-nextcloud

koa2 middle to upload file, 支持本地文件系统、 nextcloud私有云、 ipfs文件系统及以太坊

Features

  • configuration
  "ipfs":{
    "api_host": "localhost",
    "api_port": 5001,
    "gateway_port":8080
  },
  "web3":{
    "host": "localhost",
    "port": 7545,
    "account_address":"0x627306090abaB3A6e1400e9345bC60c78a8BEf57",
    "publish_contract_address": "0x345ca3e014aaf5dca488057592ee47305d9b3e10",
    "publish_contract_gas_limit": 300000
  },
  "upload": {
      "excel": {
        "provider": "local",
        "urlPath": "/upload/xslx",
        "mimetypes": [
          "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
        ]
      },
      "share": {
        "provider": "nc",
        "nc_share_path":"/share",
        "limits":{
          "fileSize":1000000
        }
      },
      "image": {
        "provider": "nc",
        "nc_share_path":"/share/images",
        "nc_image_preview": true,
        "mimetypes": ["image/png","image/bmp","image/jpeg"]
      },
      "filechain":{
        "provider": "fc"
      }
    }
  • support upload to local
options['upload'] = {
  "url": '/api/upload',
  "storeDir": 'xxx',
  "provider": "local",
  "mimetypes": ['image/png','image/bmp'], // 如果没有配置,将不进行类型检查 http://www.freeformatter.com/mime-types-list.html
  "folder": "public",
  "urlPath": "images"
}
  • support upload to nc(nextcloud)
options["upload"] = {
  "url": "/api/upload/nc",
  "provider": "nc",
  "folder": "public/upload",
  "nc_host":"http://localhost:8089/FileStore",
  "nc_admin_user":"admin",
  "nc_admin_password":"admin",
  "nc_public_group":"share"
}
  • support upload to fc(filechain with ipfs and ethereum)
options["upload"] = {
  "provider": "fc"
}

How to use

const file_uploader = require('koa-file-upload-fork')
app.use(mount(option.url,file_uploader(option).handler))

Requirements

  • Node v6.0+

Workflow

  • npm install

Keywords

koa

FAQs

Package last updated on 27 Jun 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