Hi,
I'm looking for a way of forcing a browser like IE to download a txt file instead of opening it.
I have a button in a html page, and I want the users to download a specific txt file. The problem is that if I change the url to the txt file, IE just opens it ... of course the users can then save the file, but I want to force them to download the file ... can it be done?
Code on the button (simplified):
MyForm.action = "some_related_path\\one_big_file.txt";
MyForm.target = 'Download_Window';
MyForm.submit();
HTML Form definition:
...
<form name="MyForm" action="other_page.jsp" method="post">
...
That opens a new IE window (if 'Download_Window' isn't already opened), and opens the txt file in it ... it's a really big txt file with a report, so I'm interested in forcing the download ...
Thanks.
I'm looking for a way of forcing a browser like IE to download a txt file instead of opening it.
I have a button in a html page, and I want the users to download a specific txt file. The problem is that if I change the url to the txt file, IE just opens it ... of course the users can then save the file, but I want to force them to download the file ... can it be done?
Code on the button (simplified):
MyForm.action = "some_related_path\\one_big_file.txt";
MyForm.target = 'Download_Window';
MyForm.submit();
HTML Form definition:
...
<form name="MyForm" action="other_page.jsp" method="post">
...
That opens a new IE window (if 'Download_Window' isn't already opened), and opens the txt file in it ... it's a really big txt file with a report, so I'm interested in forcing the download ...
Thanks.
