2

Is it possible to save out some javascript object purely on client-side?

My question come from the following workflow: a user enters and posts a text, i do some processing on the server side and return processed text to the user. The user can do some modifications to the returned text, if he doesn't like some processed parts of it. Is there any client-side javascript functionality so the user pressed the button 'save' and it pops a save file dialog as if the user downloaded this file from a server? Or I need a server interaction for example to post the results and return them to the users as a file?

3 Answers 3

1

You could implement this functionality with a server side functionality, but not with JavaScript. Pressing 'Save' would create an AJAX call to the server which responds with the file correct headers, making the browser respond with a "Save file" dialog.

Sign up to request clarification or add additional context in comments.

Comments

1

No. Unassisted JavaScript cannot save files (IE with activeX/WHS can use the file system, mozilla products may have something here which I have not investigated)

But you can popup a window or write it to an iframe which can be printed to for example PDF which is saved on the client

Comments

1

with javascrpipt you don't have access to the filesystem on the clients pc (except of the cookies). so you have to send him a downloadable file.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.