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.
This is the offending line of code:
byte[] fileBytes = sourceItem.File.OpenBinary();
"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?
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.
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.
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?
Trey Carroll