Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Package should contain a content type part [M1.13]

Shulou Source: shulou.com Published: 2022-06-03 07:19:38 11月23日 Update

Exception message:

Org.apache.poi.openxml4j.exceptions.InvalidFormatException: Package should contain a content type part [M1.13]

Cause of exception:

The difference in file formats between version 2007 excel and version 2003 excel results in:

HSSFWorkbook & HSSFSheet: supports xls format

XSSFWorkbook & XSSFSheet: xlsx format is supported.

Solution:

Workbook workbook = WorkbookFactory.create (fileInputStream ()); Sheet hssfSheet = workbook.getSheetAt (0)

Tags: Format support difference information reason file method Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Shulou Information vpn NVidia Microsoft