doc.save()
is doing just what it should do. You don’t want that. What else have you tried?
See:
-
How to download a file using ipywidget button? (Note that this one includes among the listed options, the ‘solara’-approach noted later in this thread.)
-
How do I enable data downloads from a jupyter webapp without writing on the server?