title: Unable to read a byte array (created from a .docx file) into a Doc object using ABCPDF
body: <p>I am retrieving a .docx file as a byte array. I am then trying to call the Doc’s read() function with said byte array as the data parameter but I am getting an unrecognized file extension error.</p>
  
  <p>I retrieve the byte array with the following (c#) code:</p>
  
  <pre><code>    WebClient testWc = new WebClient();
      testWc.Credentials = CredentialCache.DefaultCredentials;
      byte[] data = testWc.DownloadData("http://localhost/Lists/incidents/Attachments/1/Testdocnospaces.docx");
  </code></pre>
  
  <p>IF at this point I output the byte array as a .docx file, my program will correctly allow me to open or save the file. For this reason, I believe the byte array has been retrieved correctly. Here is a sample of what I mean by outputting a .docx file:</p>
  
  <pre><code>    Response.ClearHeaders();
      Response.Clear();
      Response.AppendHeader("Content-Disposition", "attachment;Filename=test.docx");
      Response.BinaryWrite(data);
      Response.Flush();
      Response.End();
  </code></pre>
  
  <p>However, if I try to read the byte array into a Doc like so:</p>
  
  <pre><code>    Doc doc = new Doc();
      XReadOptions xr = new XReadOptions();
      xr.ReadModule = ReadModuleType.MSOffice;
      doc.Read(data, xr);
  </code></pre>
  
  <p>My program will error out at the last line of said code, throwing the following: “FileExtension '' was invalid for ReadModuleType.MSOffice.”</p>
  
  <p>The Doc.Read() function seems to be finding an empty string where it would typically be finding the file type.
  Also, I do have Office 2007 installed on this machine.</p>