GithubHelp home page GithubHelp logo

alphasnow / aliyun-oss-appserver Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 3.0 352 KB

Aliyun oss signature direct transmission. 阿里云服务端签名直传OSS扩展包.

Home Page: https://alphasnow.github.io/aliyun-oss-appserver/

License: MIT License

PHP 100.00%
aliyun-oss-appserver aliyun-oss appserver oss aliyun aliyun-sdk laravel-package

aliyun-oss-appserver's Introduction

Hi there 👋

I am AlphaSnow.

Email Badge


About me

  • Learning : Full-Stack Development ⚡ | Open-Source 🔥
  • Languages : Go,PHP,Python,Javascript
  • Hobbies : Articles & Music 🎧

aliyun-oss-appserver's People

Contributors

alphasnow avatar tanghengzhi avatar telanflow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

aliyun-oss-appserver's Issues

Bug: conditions 中 maxSize 类型为字符串,导致的OSS上传失败

/**
* @return array
*/
public function toArray()
{
if (!$this->expireAt && $this->expireTime) {
$this->expireAt = time() + $this->expireTime;
}
if ($this->expireAt) {
$this->policy['expiration'] = $this->gmtIso8601($this->expireAt);
}
if ($this->maxSize) {
$this->policy['conditions'][] = ['content-length-range', 0, $this->maxSize];
}
if ($this->userDir) {
$this->policy['conditions'][] = ['starts-with', '$key', $this->userDir];
}
return $this->policy;
}

$this->policy['conditions'][] = ['content-length-range', 0, $this->maxSize];

这行代码的 $this->maxSize 如果是字符串会导致阿里云上传失败,需要intval强转一下。

<?xml version="1.0" encoding="UTF-8"?>
<Error>
  <Code>InvalidPolicyDocument</Code>
  <Message>Invalid Policy: Invalid JSON. </Message>
  <RequestId>6247FE6BDF727137315A9683</RequestId>
  <HostId>loan-ok-bang.oss-cn-hangzhou.aliyuncs.com</HostId>
</Error>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.