monitorjbl / excel-streaming-reader

An easy-to-use implementation of a streaming Excel reader using Apache POI
Apache License 2.0
943 stars 342 forks source link

FileNotFoundException exception for MultipartFile resource file #256

Open viraj-dhamal opened 2 years ago

viraj-dhamal commented 2 years ago

I am trying to read Multipart file but getting below exception- Caused by: java.io.FileNotFoundException: MultipartFile resource [file] cannot be resolved to absolute file path

I am using below code to read file-

Workbook workbook = StreamingReader.builder()
                    .rowCacheSize(100)    // number of rows to keep in memory (defaults to 10)
                    .bufferSize(4096)     // buffer size to use when reading InputStream to file (defaults to 1024)
                    .open(multipartfile.getResource().getFile());

When I am passing input stream its working fine. For performance purpose I want to pass file object to open method. Any suggestions would appreciate.