Skip to content

xcuts/upyun-H5-Restupload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

upyun-H5-Restupload

  1. 基于又拍云rest API的PUT方法对又拍云存储进行异步上传请求, PUT上传可以有效的减少上传时间,
  2. rest.html中注释的4处改为需要的信息即可使用:

  $(document).ready(function () {
	  $("#fileupload").change(function () {
		bucket_name="bucket_name";              //服务名称
		opename="opename";                      //操作员账号
		opepass="opepass";                      //操作员密码
		save_as="/rest.jpg";                    //保存路径
		acc_point="http://v0.api.upyun.com/";
		date=(new Date()).toUTCString();
		file=$(this).get(0).files[0];
		sign=SparkMD5.hash("PUT&/"+encodeURI(bucket_name+save_as)+"&"+date+"&"+file.size+"&"+SparkMD5.hash(opepass));
		infoHtml = "文件名称:" + file.name + "
"; infoHtml+= "文件大小:" + file.size + "
"; infoHtml+= "文件类型:" + file.type + "
"; $("#info").html(infoHtml); });
  • 注意:最好从后端签名传递到前端, 如果前端一定要使用这种方法, 可以后台创建一个仅有写入权限的操作员来使用.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published