OpenStack Rackspace 云文件 .net SDK

标签 openstack rackspace-cloud rackspace cloudfiles

我正在尝试将 XML 文件保存到悉尼的非 CDN 容器:

public void Save(XDocument document)
{
    using (MemoryStream ms = new MemoryStream())
    {
        document.Save(ms);
        ms.Position = 0;

        RackspaceCloudIdentity identity = new RackspaceCloudIdentity { Username = "username", APIKey = "xxxxxxxxxxx", CloudInstance = CloudInstance.Default };
        CloudFilesProvider provider = new CloudFilesProvider(identity);

        provider.CreateObject("XMLFiles", ms, "xmlFile1.xml", region: "syd");
    }
}

对于 1MB 的文件,上传大约需要 50 秒(非常长)。

并且,尝试下载回文件,返回空结果:

public void Read()
{
    RackspaceCloudIdentity identity = new RackspaceCloudIdentity { Username = "username", APIKey = "xxxxxxxxxxx", CloudInstance = CloudInstance.Default };
    CloudFilesProvider provider = new CloudFilesProvider(identity);

    using (MemoryStream ms = new MemoryStream())
    {
        provider.GetObject("XMLFiles", "xmlFile1.xml", ms, region: "syd");

        // ms.Length is 0
    }
}

我做错了什么吗?

最佳答案

呃。我在提交 799f37c 中引入了这个错误(首次发布于 v1.1.3.0)。我现在正在寻找最好的解决方法。

编辑:没有解决方法,但我提交了 issue #116对于这个问题,以及pull request之后由于已合并,我们将发布该库的 1.1.3.1 版本来纠正问题。

关于OpenStack Rackspace 云文件 .net SDK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18254455/

相关文章:

asp.net - 如何使用 web.config 从 url 中删除 index.aspx?

openstack - Rackspace CloudFile API - 获取对象信息

ubuntu - 无法建立与 http ://controller:9696/v2. 0/networks 的连接

apache-spark - 从 Spark 访问 Openstack Swift - SwiftAuthenticationFailedException

docker - 使用 Docker 驱动程序设置 Openstack Havana

php - 使用 rackspace 表单发布的内容类型不正确

node.js - "compartmentalizing services"是什么意思?

apache - htaccess 重定向 http ://and http://www to https://that plays nice with subdomains

PHP上传到rackspace CDN