我这边有一个示例~你可以参考一下~
<?php
/// (回调中的所有信息均为 UTF-8 编码,签名验证的时候需要注意编码是否一致)
$bucket = 'xxx';
$form_api_secret = 'xxx'; /// 表单 API 功能的密匙(请访问又拍云管理后台的空间管理页面获取)
$options = array();
$options['bucket'] = $bucket; /// 空间名
$options['expiration'] = time()+600; /// 授权过期时间
$options['save-key'] = '/{year}/{mon}/{random}{.suffix}';
$options['allow-file-type'] = 'jpg,jpeg,gif,png';
$options['content-length-range'] = '0,1024000';
$options['image-width-range'] = '10000,1024000';
$options['return-url'] = 'http://localhost/form-test/return.php'; /// 页面跳转型回调地址
//$options['notify-url'] = 'http://localhost/form-test/notify.php'; /// 服务端异步回调地址
$policy = base64_encode(json_encode($options));
$sign = md5($policy.'&'.$form_api_secret); /// MD5的操作员密码
?>
<form action="
http://v0.api.upyun.com/<?php echo $bucket?>/" method="post" enctype="Multipart/form-data">
<input type="hidden" name="policy" value="<?php echo $policy?>">
<input type="hidden" name="signature" value="<?php echo $sign?>">
<input type="file" name="file">
<input type="submit">
</form>