繁体   English   中英

在Silverlight 5中使用HttpWebRequest上传Blob会导致SecurityException

[英]Uploading a blob using HttpWebRequest in silverlight 5 causes SecurityException

我想创建一个silverlight5应用程序,以使用http请求将文件上传到Blob存储中,但是当我使用结束响应时

HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(asyncResult);

它会引发“安全错误”。 我已经搜索了很多东西,发现是将clientaccesspolicy.xml文件上传到我的存储帐户的根目录。 我已将此文件上传到根级别的存储帐户,但无法正常工作。 请帮我。 提前致谢。

我发现了错误。 clientaccesspolicy.xml中的内容有点错误。 我在uri中使用*作为域

<access-policy>
  <cross-domain-access>
    <policy>
      <allow-from http-request-headers="SOAPAction">
      // for me, this line was was giving an error (using * for uri) 
      //   <domain uri="*" />
      //  now I am using 
         <domain uri="http://*" />
         <domain uri="https://*" />
      </allow-from>
      <grant-to>
        <resource path="/" include-subpaths="true"/>
      </grant-to>
    </policy>
  </cross-domain-access>
</access-policy>

谢谢 :)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM