Client object model vs Server object model - FileInformation object RRS feed

  • Question

  • Hi,

    I have a piece of code that opens an Excel document sitting in a document library. The developer who wrote the code uses the Client Object Model to retrieve the file. Now, this causes some problems on the production server.

    I'm trying to look into using the server object model instead, but I can't seem to find the server object that is the 'same' as the client object FileInformation. 

    Does anyone know?



    Friday, November 26, 2010 1:32 PM


  • Hi R,

    FileInformation, correlates the file information on the client with the file information on the server.

    Im assuming that you want to get a stream from a Document inside sharePoint right?

    Do like this:

    //Get file from SPWeb
    SPFile file = web.GetFile(fileUrPath);

    //Get Stream from file
    using (StreamReader fileStream= new StreamReader(file.OpenBinaryStream()))
     //use fileStream to do what you want


    Hope it helps

    Rodrigo Pinto,SharePoint Specialist, Evangelist
    SharePointPt Founder
    PS- If you think reply answer your question, propose as an answer

    • Marked as answer by Wayne Fan Thursday, December 2, 2010 3:15 AM
    Saturday, November 27, 2010 2:40 AM