Invalid data error while download a word/excel file programatically in sharepoint 2007

Unanswered Invalid data error while download a word/excel file programatically in sharepoint 2007

  • Tuesday, July 31, 2012 12:45 PM
     
     

    Hi,

    I have a custom  webpart in which I wants to download the files from a document library.

    This is the code:

    SPFile file = objWeb.GetFile(FileUrl);

    byte[] fileData= file.OpenBinary();

    But int the fileData object some additional html and javascript contents are automatically added.

    I do not khow from where the contents are added to the file (May be Automatically added by Sharepoint).

    Can any one helps me to remove the additional contets and get the original file.

    Thanks

    Bijendra