Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Your InputStream was neither an OLE2 stream, nor an OOXML stream

 
Manjesh Patil
Ranch Hand
Posts: 42
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using Apache Commons libraries to upload a .docx file . I want to extract the text using Apache POI at the same time. My application server(Google App egine) does not allow to create files so I cannot write to file. This is the reason I need to extract the text from uploaded file and store it as String object or BLOB in database.

While doing so I cannot pass the inputStream returned by ServletFileUpload to Apache POI API, it is throwing an exception Your InputStream was neither an OLE2 stream, nor an OOXML stream
the POI API expects a FileInputStream but the inputStream returned by ServletFileUpload is not compatible ..


I am passing a valid .docx file.
how should I handle this?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic