Skip to content

Commit d4a4d4f

Browse files
committed
Relates to #2
1 parent 1652a42 commit d4a4d4f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ReflectXMLDB/DatabaseHandler.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,13 @@ public void ExportDatabase(string pathToSave, string filename, string fileExtens
870870

871871
//3. Archive this temp folder to the database file
872872
string fullFilePath = Path.Combine(pathToSave, filename + fileExtension);
873-
ZipFile.CreateFromDirectory(tempFolder, fullFilePath);
873+
if(File.Exists(fullFilePath))
874+
{
875+
//If the file already exists, delete and recreate
876+
File.Delete(fullFilePath);
877+
}
878+
879+
ZipFile.CreateFromDirectory(tempFolder, fullFilePath, CompressionLevel.Optimal, false);
874880

875881
//4. Delete temp folder
876882
Directory.Delete(tempFolder, true);

0 commit comments

Comments
 (0)