Skip to content

Commit

Permalink
Relates to #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Fe-Bell committed Jun 13, 2020
1 parent 1652a42 commit d4a4d4f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ReflectXMLDB/DatabaseHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,13 @@ public void ExportDatabase(string pathToSave, string filename, string fileExtens

//3. Archive this temp folder to the database file
string fullFilePath = Path.Combine(pathToSave, filename + fileExtension);
ZipFile.CreateFromDirectory(tempFolder, fullFilePath);
if(File.Exists(fullFilePath))
{
//If the file already exists, delete and recreate
File.Delete(fullFilePath);
}

ZipFile.CreateFromDirectory(tempFolder, fullFilePath, CompressionLevel.Optimal, false);

//4. Delete temp folder
Directory.Delete(tempFolder, true);
Expand Down

0 comments on commit d4a4d4f

Please sign in to comment.