You need to sign in to do that
Don't have an account?
![Karthick Raja Karthick Raja](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
How to download file(text) in visualforce page
Hi folks,
I have a visualforce page in which there is a button called download.
If I click that button then it will download all the account records as text file. For this use case how we can implement.
I Dont want to redirect to another visualforce page
Can someone suggest some ideas to implement.
VFP:
![User-added image](/forums/servlet/rtaImage?eid=906F0000000B3H1&feoid=Body&refid=0EMF0000000QpAp)
Thanks in advance,
Karthick
I have a visualforce page in which there is a button called download.
If I click that button then it will download all the account records as text file. For this use case how we can implement.
I Dont want to redirect to another visualforce page
Can someone suggest some ideas to implement.
VFP:
Thanks in advance,
Karthick
My guess at the VF page
Controller
I'm encoding it as base64 to make the url safe and not having to escape anything. But you can do it without encoding if you escape correctly.
[1] http://cwestblog.com/2014/10/21/javascript-creating-a-downloadable-file-in-the-browser/