Download Excel from resources

So I have a button that once click and trigger download action. I want it to download an excel that I put into the resources folder but is pops the following error:

Why is this happening? and is Resources the correct place for me to place my custom file?

Stephen Li wrote:

So I have a button that once click and trigger download action. I want it to download an excel that I put into the resources folder but is pops the following error:

Why is this happening? and is Resources the correct place for me to place my custom file?

Hi Stephen Li,

 Is it a mobile / web application?

You have to give to it the binary (file content) and the file name.

If it is mobile, you can take a look here: https://www.outsystems.com/forums/discussion/27001/how-to-download-pdf-docx-xlsx-from-binary-in-db-to-mobile-app/


Cheers

Solution

Try setting the file content to the "Content" property instead of just the file in resources. eg


So in your case it should read Resources,PaymentDetailFormat_xlsx.Content


BTW, when you add the resource, don't forget to set the deploy action, it defaults to do nothing and catches a lot of people




Solution

John Williams wrote:

Try setting the file content to the "Content" property instead of just the file in resources. eg


So in your case it should read Resources,PaymentDetailFormat_xlsx.Content


BTW, when you add the resource, don't forget to set the deploy action, it defaults to do nothing and catches a lot of people




Noob overlooking the details.... Thank you very much.

What does it mean by deploying? All I needa do is to set it to the value as you mentioned?

Yes, if you leave it as "Do Nothing" then it won't actually copy the resource up to the server, Just make certain that it is set to Deploy to Target Directory and you will be find. 

To be honest I don't see the sense in it defaulting to Do Nothing in the first place, If I add a resource to a project then by definition I want it uploaded :)