Is it possible to use client-side JavaScript to make the browser behave the same way as when it encounters "Content-disposition: attachment; filename=..."? This would mean that the data for the file to be saved is only available on the client side.
For example, let's say we have a JavaScript Array on the client side:
var data = [
["aa","bb","cc","dd","ee","ff","gg","hh","ii"],
[ 1, 2, 3, 4, 5, 6, 7, 8, 9],
..
];
And we want to save this array as a text file on the user's computer. The user should be prompted for the file name (without trying to bypass the browser's security settings).
Is it possible to achieve this without storing the array in a temporary file on the server and then making another request to retrieve this temporary file for the user? If there is no straightforward solution, any suggestions, search keywords, or links would be greatly appreciated.