title: Creating an xssf workbook from an uploaded .xlsx(2007 Excel file)
body: <p>In the code the client uploads a standard .xlsx file through struts.</p>
  
  <p>In the action we take the file using </p>
  
  <pre><code>FormFile myfile = ABCForm.getTheFile();
  </code></pre>
  
  <p>My query is how would I create a XSSFWorkbook out of this file.</p>
  
  <p>I also have a parallel process for accessing 2003 excel file this way</p>
  
  <pre><code>FormFile myfile = ABCForm.getTheFile();
  byte[] fileData = myFile.getFileData();
  ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(fileData);
  
  in the Helper class
  
  POIFSFileSystem fs = new POIFSFileSystem(byteArrayInputStream);
  HSSFWorkbook wb = new HSSFWorkbook(fs);
  </code></pre>
  
  <p>and then further processing of the workbook.</p>
  
  <p>I would like to know how to create a XSSFWorkbook as I have created the HSSFWorkbook above.</p>
  
  <p>I have all the ooxml and related jars in the classpath and lib folder.</p>
  
  <p>XSSFWorkbook cannot be created from byteArrayInputStream. <a href="http://poi.apache.org/apidocs/org/apache/poi/xssf/usermodel/XSSFWorkbook.html" rel="nofollow">Apache XSSF Workbook</a> . It can only be created from Inputstream and OPCPackage.</p>
  
  <p>Any ideas/pointers on how to go about further. I will be glad to give further details about any other code snippets that would help.</p>