How to download client content

I want the user to load the current contents of the text field into a text file on his computer. I used to create an iframe pointing to a data URL that would launch a file upload dialog. However, this time the data is client.

So, is it possible to allow the user to upload data without sending them to the server?

+3
source share
2 answers

Is it possible to download user data without sending it to the server side?

Generally not.

URL- data:, janmoesen ( URL- URL-, , %nn).

, IE. (IE8 URL- , ). , URL- , , .

( POST, Content-Disposition: attachment . Content-echo script . )

+5

" ", IE, 'data:text/plain,' + yourTextarea.value. / Ctrl + S.

+6

Source: https://habr.com/ru/post/1740761/


All Articles