0

the subject error occurs when I try to upload a .doc file in Hebrew language to a SharePoint list.

XmlDocument document = new XmlDocument();
            if (_view.DocumentStream != null)
            {
                document.Load(_view.DocumentStream);

the exception is raised on .Load() metod and DocumentStream si a Stream type. There is a charset problem with the Hebrew character but I don't know how resolv it. Thanks and regards,

Vito

vibon82
  • 1
  • 1
  • 2
    A .doc file is not an XML document. – zmbq Jun 27 '12 at 10:21
  • .doc files in english language are uploaded correctly with this code. – vibon82 Jun 27 '12 at 11:43
  • Perhaps these are DOCX files, and you're opening the main part of them (DOCX files are ZIP files)? Check the XML you're opening and see it's encoding. It should be on the top line, the – zmbq Jun 27 '12 at 20:39

1 Answers1

0

A .doc file is not an XML document, thus the first thing the XML parser will run into will look something like

ÐÏࡱá

This is not a problem with the language of the document, but the method you are using.

This question is what you need to be asking:

Sharepoint API - How to Upload files to Sharepoint Doc Library from ASP.NET Web Application

Community
  • 1
  • 1
Nat
  • 14,175
  • 5
  • 41
  • 64