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

@blueshit/oss-sign

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blueshit/oss-sign

阿里云OSS签名

  • 1.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
increased by100%
Maintainers
2
Weekly downloads
 
Created
Source

oss-sign

阿里云OSS签名

const OSSSign = require("@blueshit/oss-sign");

const signer = new OSSSign({
  accessKeyId: 'xxx',
  accessKeySecret: 'xxx',
  endpoint: 'http://xxx.oss-cn-hangzhou.aliyuncs.com',
})

/**
 * 获取 OSS 签名
 * @param {string} filename 文件名
 * @param {ISignOption} options 签名参数
 * @param {string} options.dir 目录前缀
 * @param {number} options.maxSize 文件最大尺寸(字节)
 * @param {number} options.expire 过期时间(秒)
 */
signer.sign('filename.jpg');

前端使用方法

参考: http://oss-demo.aliyuncs.com/oss-h5-upload-js-php/index.html

注意:bucket必须设置了Cors(Post打勾),不然没有办法上传

Keywords

FAQs

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

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