<script type="text/javascript">
function urlreadimg()
{
var eleAppend = document.getElementById("result");
var xhr = new XMLHttpRequest();
console.debug(" xhr.open");
xhr.open("GET","http://oss-cn-hangzhou.aliyuncs.com/friday-head/photo_11010119_1428718533175.jpg",true);
xhr.responseType = "blob";
xhr.setRequestHeader("Access-Control-Allow-Origin", "*");
xhr.onreadystatechange=function()
{
if (xhr.readyState==4 && xhr.status==200)
{
// document.getElementById("myDiv").innerHTML=xhr.responseText;
console.debug("将this.response 赋值给BLOB");
var blob = xhr.response;
var img = document.createElement("img");
img.onload = function(e) {
window.URL.revokeObjectURL(img.src); // 清除释放
};
img.src = window.URL.createObjectURL(blob);
eleAppend.appendChild(img);
}
}
xhr.send();
}
</script>
<p>
<input type="button" value="读取aliyun文件" onclick="urlreadimg()" />
</p>
<div id="result" name="result"></div>
<div id="result" name="results"></div>
看了几个帖子说要设置CORS 完全不懂的怎么弄。
还有个帖子说要弄python....完全没必要吧。
希望大神们给指导
Re通过AJAX获取OOS上的图片并且转换成BASE64
看我的帖子:阿里云OSS跨域AJAX上传OPTIONS请求403问题的解决方案
http://bbs.aliyun.com/read/250407.html
2015-07-16 16:52:46
企业邮箱发送邮件时,若出现投递失败产生退信,内容提示包含如下: the mta server of * reply:550 failed to meet SPF requirements 或者 the mta server of 163.com — 163mx01.mxmail.netease.com(220.181.14.141) reply:550 MI:SPF mx14,QMCowECpA0qTiftVaeB3Cg—.872S2 1442548128 http://mail.163.com/help
301703