Import one Excel template in Web Dev and for on click on download that in Perspective

i am using ignition 8.1.35 version ,i have to imported one excel file in web dev file resource , While uploading that file MIME type is set to application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
and in perspective on clicking on the button i would like to download that excel file, so i used the below code

Define the path to the file resource

filePath = "webdev/fileResources/template.xlsx" # or template.xls

Trigger the download

system.perspective.downloadFile(filePath, "template.xlsx") # or template.xls
when i click that button i am able to download the excel file but i am not able to open it. its telling file extension or format is incorrect
is there any solution

To start, why do you need the web dev module?

To answer the question you asked, you simply use the system.perspective.download function and pass in the filename and byte stream of the excel document.

I have an Excel template that contains all the necessary details. Users can refer to this template to understand the required format for importing their Excel files into the application

Sorry for the delayed response. Please try and reply by hitting the reply button under the post you are responding to so they get notified.

I think you would just need to do an httpGet of the filepath and then convert that to a bytearray for the system.perspective.download to function properly.