This commit is contained in:
2009-05-05 13:26:14 +00:00
parent 316c64a981
commit 6f5eefd476
3 changed files with 14 additions and 7 deletions

View File

@@ -109,8 +109,13 @@ namespace DataLoader
int nBytesRead = fs.Read(ByteArray, 0, (int)len);
fs.Close();
string t1 = (title == null || title == "") ? null : title;
Document doc = Document.MakeDocument(t1, ByteArray, null, ci == null ? null : ci.ToString(), DateTime.Now, "Migration");
return doc.DocID;
Document doc = Document.MakeDocument(t1, ByteArray, null, ci == null ? null : ci.ToString(), DateTime.Now, "Migration", ".Doc");
FileInfo tmpFile = new FileInfo(temppath);
FileInfo doctmpFile = tmpFile.CopyTo(temppath.Substring(0,temppath.LastIndexOf(".")) + @".doc");
doc.UpdateDocAscii(temppath.Substring(0, temppath.LastIndexOf(".")) + @".doc");
doc.Save();
DocumentInfo di = DocumentInfo.Get(doc.DocID);
return doc.DocID;
}
// for an io exception, keep trying
catch (IOException)