excel-plus
excel-plus copied to clipboard
导入excel报错:Zip bomb detected! The file would exceed the max. ratio of compressed file size to the size of the expanded data.
Zip bomb detected! The file would exceed the max. ratio of compressed file size to the size of the expanded data.
This may indicate that the file is used to inflate memory usage and thus could pose a security risk.
You can adjust this limit via ZipSecureFile.setMinInflateRatio() if you need to work with files which exceed this limit.
Uncompressed size: 147803, Raw/compressed size: 1462, ratio: 0.009892
Limits: MIN_INFLATE_RATIO: 0.010000, Entry: xl/styles.xml"}
java.io.IOException: Zip bomb detected! The file would exceed the max. ratio of compressed file size to the size of the expanded data.
This may indicate that the file is used to inflate memory usage and thus could pose a security risk.
You can adjust this limit via ZipSecureFile.setMinInflateRatio() if you need to work with files which exceed this limit.
Uncompressed size: 147803, Raw/compressed size: 1462, ratio: 0.009892
Limits: MIN_INFLATE_RATIO: 0.010000, Entry: xl/styles.xml
at org.apache.poi.openxml4j.util.ZipArchiveThresholdInputStream.checkThreshold(ZipArchiveThresholdInputStream.java:130)
at org.apache.poi.openxml4j.util.ZipArchiveThresholdInputStream.read(ZipArchiveThresholdInputStream.java:80)
at org.apache.poi.util.IOUtils.toByteArray(IOUtils.java:151)
at org.apache.poi.util.IOUtils.toByteArray(IOUtils.java:120)
at org.apache.poi.openxml4j.util.ZipArchiveFakeEntry.
设置了一下ZipSecureFile.setMinInflateRatio(-1.0d);就可以了