B2017-255 Get the correct file length before saving the contents to the database

This commit is contained in:
Rich 2017-11-08 18:51:54 +00:00
parent 090b3cd452
commit c1cacb93a4

View File

@ -543,6 +543,7 @@ namespace VEPROMS.CSLA.Library
// TODO: Add Try & Catch logic
if (_MyDocument == null) return;
Document doc = _MyDocument.Get();
MyFile.Refresh(); // B2017-255 Get the latest file length before reading and saving
FileStream fs = _MyFile.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
long savLen = _MyFile.Length;
Byte[] buf = new byte[_MyFile.Length];