widgets.Button for handling download
See original GitHub issueHi, I would like to create a download button from widgets.Button
, is it possible to do that?
I know that the download can be achieved using link tag, i.e.
<a href="link/to/file" download>test_download</a>
Using button, I am not sure what to put to handle the download of the temporary file I created.
...
def on_button_download_clicked(b):
# TODO: Handle download
# Disable button after downloading
btn_download.disabled = True
btn_download.on_click(on_button_download_clicked)
...
Cheers
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:8 (2 by maintainers)
Top Results From Across the Web
How to download a file using ipywidget button? - Stack Overflow
The most elegant way I've seen is Solution 1 here (slightly modified and presented below): from ipywidgets import HTML from IPython.display ...
Read more >How to Create a File Download Button in Elementor - YouTube
The files can be downloaded easily by your website visitors, with one click, onto a computer or ... Related Links: Button Widget tutorial ......
Read more >Create a download button - Flutter documentation
Create a download button · Define a new stateless widget · Define the button's possible visual states · Display the button shape ·...
Read more >JetElements: How to Use Download Button Widget - Crocoblock
The Download Button widget of JetElements will come in handy if you want your visitors to download files of any type. With it,...
Read more >Widget Events — Jupyter Widgets 7.7.0 documentation
The Button is not used to represent a data type. Instead the button widget is used to handle mouse clicks. The on_click method...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found this thread trying to do exactly what @marketneutral said. I had the same thought that it must be a very easy/standard thing. I had issues when trying to use even an anchor within the notebook. It was getting Forbidden errors. I found something called
FileLink
.Quick example:
I did some more searching and found this StackOverflow post. I added my answer (based on comments) if anyone else needs.
Yes, I think you are right – it’s a duplicate. #2445 is closed but I admit that I don’t readily follow that accepted answer. I can’t seem to find anything anywhere that gives an example of basic and core button functionality:
ipywidgets
button that when clicked, follows a link to another webpage?ipywidgets
button send a file to the browser?