This commit is contained in:
2012-06-11 16:20:03 +00:00
parent c9d962d01d
commit 136a023564
3 changed files with 14 additions and 9 deletions

View File

@@ -287,15 +287,17 @@ 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(), dtsutc, "Migration", ".Doc");
FileInfo tmpFile = new FileInfo(temppath);
string docfile = temppath.Substring(0, temppath.LastIndexOf(".")) + @".doc";
if (File.Exists(docfile)) File.Delete(docfile);
FileInfo doctmpFile = tmpFile.CopyTo(docfile);
doc.DocAscii = ascii;
doc.Save();
File.Delete(docfile);
return doc.DocID;
using (Document doc = Document.MakeDocument(t1, ByteArray, null, ci == null ? null : ci.ToString(), dtsutc, "Migration", ".Doc"))
{
FileInfo tmpFile = new FileInfo(temppath);
string docfile = temppath.Substring(0, temppath.LastIndexOf(".")) + @".doc";
if (File.Exists(docfile)) File.Delete(docfile);
FileInfo doctmpFile = tmpFile.CopyTo(docfile);
doc.DocAscii = ascii;
doc.Save();
File.Delete(docfile);
return doc.DocID;
}
}
// for an io exception, keep trying
catch (IOException exio)