My Oracle Support Banner

Not Able To Open Excel .xls Files Using The Oc4j Container (Doc ID 549117.1)

Last updated on NOVEMBER 08, 2018

Applies to:

Oracle Containers for J2EE - Version:
This problem can occur on any platform.


When executing the application and the request for the excel page is submitted,
the browser ask if user wants to either open or save the file.
But the file name is shown as   " valRpt?fp=082007 "
It is then selected to open, and an error is displayed:

" Microsoft Office Excel cannot access the file : https://host:port/dr/valRpt?fp=082007 "

The expected file name was valReport.xls

The page is produced by the following code:

// prepare workbook and get ready to process data
HSSFWorkbook workbook = ValidationReport.writeReport(locationNumber, financialPeriod);

response.setHeader("Content-Disposition", "attachment; filename=valReport.xls");
response.setHeader("Cache-Control", "cache-response-directive=private");

OutputStream ostream = response.getOutputStream();

When the file is placed under ORACLE_HOME/Apache/Apache/htdocs, and the file is accessed through
the browser, the excel page is correctly delivered and uploaded at the workstation. If it is accessed from oc4j container it gives error.


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.