views:

243

answers:

1

I,m try to open SPFile in binary format:

SPFolder Folder = web.GetFolder(item.Attachments.UrlPrefix);

            foreach (SPFile File in Folder.Files)
            {

                byte[] CopyFile = File.OpenBinary();  

            }

but the result byte [1]=0, what i'm doing wrong?

+1  A: 

The code you have posted should work just fine. Are you sure the file in question isn't just a single byte file?

Steve Danner
Thank you! You are right, file size is 0
Sibirman
FYI, You will get a 0 size file if there is a problem opening the file.
JD