From 6b9e84ef771c5df2f697456e61b9cbde967935bb Mon Sep 17 00:00:00 2001 From: zbyszard Date: Mon, 6 Nov 2023 11:43:27 +0100 Subject: [PATCH] make it possible to set UseZip64 flag --- ooxml/XSSF/Streaming/SXSSFWorkbook.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ooxml/XSSF/Streaming/SXSSFWorkbook.cs b/ooxml/XSSF/Streaming/SXSSFWorkbook.cs index 45ff5adcd..888355792 100644 --- a/ooxml/XSSF/Streaming/SXSSFWorkbook.cs +++ b/ooxml/XSSF/Streaming/SXSSFWorkbook.cs @@ -101,6 +101,12 @@ public int RandomAccessWindowSize /// private bool _compressTmpFiles = false; + /// + /// setting this flag On allows to write large files; + /// however, this can lead to compatibility issues + /// + private UseZip64 _useZip64 = UseZip64.Off; + /// /// shared string table - a cache of strings in this workbook. /// @@ -152,6 +158,13 @@ public bool IsHidden set { XssfWorkbook.IsHidden = value; } } + public UseZip64 UseZip64 + { + get { return _useZip64; } + + set { _useZip64 = value; } + } + #region Constructors /** @@ -444,7 +457,7 @@ private void InjectData(FileInfo zipfile, Stream outStream, bool leaveOpen) try { zos.IsStreamOwner = !leaveOpen; - zos.UseZip64 = UseZip64.Off; + zos.UseZip64 = _useZip64; //ZipEntrySource zipEntrySource = new ZipFileZipEntrySource(zip); //var en = zipEntrySource.Entries; var en = zip.GetEnumerator();