I create a PDF file in a notebook and save it to disk.
When I try to download it via a link (<a href="{pdf_file}">Click here to download: {pdf_file}</a>
) in the notebook I get a 404 not found error message.
it’s because a /files/ folder is added to the url when the link is generated, but I don’t know how to set it up, and creating a /files/ folder under the root is obviously not enough.
I have tried to specify folders in the jupyter_notebook_config.py file
by adding values such as :
c.ExtensionApp.static_paths = [os.path.join(os.environ['HOME'], 'files')]
c.ServerApp.extra_static_paths = [os.path.join(os.environ['HOME'], 'files')]
c.ServerApp.extra_static_paths = ['./files/']
In none of the cases, although the file is present in the indicated folder, can I download it.
What am I doing wrong?
Do you have an example that works?
my configuration:
Selected Jupyter core packages...
IPython : 8.1.1
ipykernel : 6.9.1
ipywidgets : 8.1.3
jupyter_client : 7.4.9
jupyter_core : 5.7.2
jupyter_server : 2.14.1
jupyterlab : 4.2.2
nbclient : 0.5.11
nbconvert : 7.16.4
nbformat : 5.10.4
notebook : 7.2.1
qtconsole : 5.2.2
traitlets : 5.14.3
Thanks