Hi,
I have HSSFWorkbook Object using wich I have to create an excel file in /content/dam.
//code snippet
InputStream is = new ByteArrayInputStream(workbook.getBytes());
AssetManager assetManager = resourceResolver.adaptTo(AssetManager.class);
assetManager.createAsset("/content/dam/test-report.xls", is, "application/vnd.ms-excel", true);
the above lines creating the excel file,but I am unable to open the file.
how to resolve this issue?
Thanks,
Radhakrishna N
Solved! Go to Solution.
Views
Replies
Total Likes
Here is the problem
com.day.cq.dam.core.process.CommandLineProcess execute: mime type [application/vnd.ms-excel] of asset [/content/dam/report.xls] is not in list of accepted mime types [[image/eps, image/x-eps, application/postscript, application/eps, application/x-eps]], ignoring.
it is not finding the mimetype
Go to felix console configuration
OSGI -> Configuration -> Apache Sling MIME Type Service
Add the mimetype application/vnd.ms-excel
and try again
Views
Replies
Total Likes
Where are you trying to open the file?
Views
Replies
Total Likes
When you upload an Excel file to AEM, you can see it in the DAM, as shown here:
[img]Excel.png[/img]
You can download the excel file,
The DAM is a repository to store the file - but you cannot open and view the excel data in AEM.
Views
Replies
Total Likes
I created the excel using AssetManager API. Downloaded the file from DAM admin console. but I am unable to open the file.
I have attached the downloaded excel file.
Thanks,
Radhakrishna N
Views
Replies
Total Likes
Have you tried creating file using any other format like pdf, csv, just to see whether they have the same problem.
When it creates the file please look into error.log for any errors.
Views
Replies
Total Likes
Radha Krishna.N wrote...
I created the excel using AssetManager API. Downloaded the file from DAM admin console. but I am unable to open the file.
I have attached the downloaded excel file.
Thanks,
Radhakrishna N
I was able to download and open it - You just can't view it in AEM.
Views
Replies
Total Likes
tried with csv extension, facing the same issue.
when I write the file to filesystem and try to open, it is opening!!
but when I write to CRX, then download from DAM console and try to open, it is not.
Also, We have updated Update Asset workflow to exclude Assets other than Image files. Is this causing the issue?
I have attached part of log file generated when excel file created in AEM.
Views
Replies
Total Likes
Here is the problem
com.day.cq.dam.core.process.CommandLineProcess execute: mime type [application/vnd.ms-excel] of asset [/content/dam/report.xls] is not in list of accepted mime types [[image/eps, image/x-eps, application/postscript, application/eps, application/x-eps]], ignoring.
it is not finding the mimetype
Go to felix console configuration
OSGI -> Configuration -> Apache Sling MIME Type Service
Add the mimetype application/vnd.ms-excel
and try again
Views
Replies
Total Likes
Issue I am facing only when I create the excel file and download and try to open.
but If I upload any other existing excel using dam console and download the same file and try to open, it is opening.
I did not add any mime type in OSGI config, though.
Views
Replies
Total Likes