listItem.File.OpenBinary() 不起作用 - SQL Server 上未启用远程 Blob 存储/文件流是罪魁祸首吗? [英] listItem.File.OpenBinary() not working - Remote Blob Storage / FileStreaming not enabled on SQL Server the culprit?

查看:62
本文介绍了listItem.File.OpenBinary() 不起作用 - SQL Server 上未启用远程 Blob 存储/文件流是罪魁祸首吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将一个 cmd 行迁移实用程序从 DEV 转移到 QA,但遇到了一个奇怪的错误.当然,在 dev 上一切正常.

I'm moving a cmd line migration utility from DEV to QA and I'm running into a strange error. Of course, things work perfectly on dev.

这是有问题的代码行:

byte[] fileBytes = sourceItem.File.OpenBinary();

无法打开文件错误".内部异常显示 COM HResult 代码为 0x81070211

"Cannot Open File Error". Inner exception shows COM HResult code is 0x81070211

我已确保我的帐户对我试图从中提取此文件的库具有所有者权限.我什至让自己成为了农场管理员 - 但我仍然遇到同样的错误.

I have made sure that my account has owner permissions on the library that I'm attempting to pull this file from. I have even made myself a farm admin - but I still get the same error.

我看到其他几个人也遇到了同样的错误,但没有解决方案.一个帖子提到通过代码下载文件作为一种解决方法 - 那会是什么样子?

I'm seeing that several other people have encountered this same error, but no solutions. One post mentions downloading the file through code as a workaround - what would that look like?

我还看到有人将此问题链接到大于 100Kb 的文件,并且可以通过将程序集放入 GAC 来解决该问题.但是,这对于该应用程序来说是有问题的.

I'm also seeing that some link this problem to files > 100Kb and that it can be overcome by putting the assembly into the GAC. However, this would be problematic for this application.

是的,我也尝试过使用所有不同的选项参数.我还尝试了使用 OpenBinaryStream 打开 Stream、获取长度并将数据读入 byte[] 数组的解决方法.结果总是一样的.有些东西不允许我访问文件以读取字节 - 错误消息毫无用处.

Yes, I have also tried using all of the different options parameters. I have also tried the workaround of just opening a Stream by using OpenBinaryStream, getting the length and reading the data into the byte[] array. The result is always the same. Something is disallowing me from getting access to the file to be able to read in the bytes – and the error message is just useless.

预先感谢您提供的任何帮助.

Thanks in Advance for any help you can provide.

我现在认为问题可能与远程 Blob 存储有关.几篇帖子都提到只有当文件大小 > 100kb 时才会出现问题.这恰好是文件从内容数据库移动到文件系统的限制.我相信 DBA 必须在 SQL Server 数据库上启用 FileStreaming 才能解决这个问题.我正在等待我们的临时 DBA 对这个建议采取行动.如果有效,我会跟进报告.与此同时 - 其他人有在 RBS 文件上使用 OpenBinary 的经验吗?

I now believe that the problem may be related to Remote Blob Storage. Several of the posts have mentioned that the problem is only when the file size is > 100kb. That happens to be the limit at which files move from the content db to the file system. I believe that the DBA must enable FileStreaming on the SQL Server database in order to fix this problem. I'm awaiting our offshort DBA to act on this suggestion. I will follow up with a report if it works. In the meantime - anybody else have experience with using OpenBinary on files with RBS?

特雷·卡罗尔

推荐答案

问题是由于 StoragePoint.运行 OpenBinary() 调用的帐户必须具有对 StoragePoint 数据库的显式访问权限.

The problem was due to StoragePoint. The account running the OpenBinary() call must have explicit access to the StoragePoint databases.

这篇关于listItem.File.OpenBinary() 不起作用 - SQL Server 上未启用远程 Blob 存储/文件流是罪魁祸首吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆