Unable to open External Attachment file (Excel) in browser using tools.sendFile
I'm having a screen in my application where I have option to upload files of type .xlsx format. Once the user uploads a file, it gets stored in DB in Base64 format. Once uploaded I'm giving an option to the user for download of the same file. In order to download I'm using "Open URL in Window" on click action of the file link where I'm calling an Activity which has the following java for download of the file:
ClipboardPage myPage = tools.findPage("DataAdministrationPage");
String sErrorMessage = tools.sendFile(myPage, "UploadFileSource", true, null, "Export.xlsx", false, null, true);
where the DataAdministrationPage in clipboard contains the filename and the file data (Base64 format in UploadFileSource property)
But when on click the file gets downloaded from new window I'm unable to open it both in browser and Microsoft Excel. It says "Excel cannot open the file because the file format or file extension is not valid".
Please let me know if I'm doing anything wrong. It's urgent.
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
Keep up to date on this post and subscribe to comments
- Issues with launching the excel file using tools.sendFile API
- Unable to render External Attachment data in browser
- Unable to Attach External Files in the Application
- While Scheduling the Report using ReportEditor Tool, am receiving the mail with attachment of excel having 4MB it is working fine (excel contain limited 5000 records). But excel contain 10000 records it means size of excel sheet is more than 10MB
- Unable to download the CSV file from server path and open blank in excel format