I was wondering if it is possible to make the browser behave the same as when viewing "Content-disposition: attachment; filename = ..." using only client-side javascript? This means that the data for the file to be saved is available only on the client side.
those. Suppose we have an array of JavaScript, only 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 I want to save this array as a text file to the user's computer. The user should receive a request for the file name (i.e. I am not trying to bypass the browser security settings or something like that).
Is it possible to do this without storing the array in a temporary server file and making another request to return this temporary file to the user? If there is no simple answer to this question - any ideas, Google keywords or links are very much appreciated.
source share