Skip to content

Commit

Permalink
Merge pull request #1207 from Zbyszard/feature/settable-usezip64-flag
Browse files Browse the repository at this point in the history
Make it possible to set UseZip64 flag
  • Loading branch information
tonyqus authored Nov 6, 2023
2 parents c22596d + 6b9e84e commit 0eecfeb
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion ooxml/XSSF/Streaming/SXSSFWorkbook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ public int RandomAccessWindowSize
/// </summary>
private bool _compressTmpFiles = false;

/// <summary>
/// setting this flag On allows to write large files;
/// however, this can lead to compatibility issues
/// </summary>
private UseZip64 _useZip64 = UseZip64.Off;

/// <summary>
/// shared string table - a cache of strings in this workbook.
/// </summary>
Expand Down Expand Up @@ -152,6 +158,13 @@ public bool IsHidden
set { XssfWorkbook.IsHidden = value; }
}

public UseZip64 UseZip64
{
get { return _useZip64; }

set { _useZip64 = value; }
}


#region Constructors
/**
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 0eecfeb

Please sign in to comment.