Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloading html file from file explorer opens file in new tab instead of downloading #6525

Closed
kevmk04 opened this issue Jun 10, 2019 · 6 comments
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Milestone

Comments

@kevmk04
Copy link

kevmk04 commented Jun 10, 2019

I have an .html file that was generated by the plotly offline.iplot function. My typical workflow is to create the file from a notebook and download the html file to share with colleagues. On an existing jupyterhub/jupyterlab install this functionality works fine. It downloads directly to my local download folder.

I recently setup a TLJH install on a new server. When I try to download the same .html file (or any html file for that matter), it opens the file in a new browser tab instead of downloading it. It also seems to try to do this with other file extensions and then downloads them normally, but it does flash open a new tab briefly before downloading. The older install does not exhibit that same flash of a new tab for other files types.

I'm using Chrome as the browser.

Old jupyterhub/jupyterlab setup where download works:
jupyterhub version: 0.8.1
jupyterlab version: 0.35.4
notebook version: 5.4.1
Installed manually

New jupyterhub/jupyterlab setup where download does not work:
jupyterhub version: 1.0
jupyterlab version: 0.35.4
notebook version: 5.7.8
Installed with TLJH installer

I'm unsure if this is a jupyterlab issue, something with TLJH install, or something else entirely.

@kevmk04
Copy link
Author

kevmk04 commented Jun 10, 2019

#6139 pull request seems to be the difference between the two setups. The older install still has the old element.setAttribute('download', ''), not sure why though. My understanding is that the element.setAttribute('target', '_blank') forces a new window to be opened.

@scottkall
Copy link

I'm having a similar issue with a multiqc HTML report. One other variable is that Chrome may have updated. Are your Chrome versions the same across both setups?

@kevmk04
Copy link
Author

kevmk04 commented Jun 12, 2019

Good call! I'll double-check what version of chrome this is but both setups were tested in the same browser session on the same computer.

Additionally, this same behavior seems to also be happening with .png images.

@kevmk04
Copy link
Author

kevmk04 commented Jun 12, 2019

My chrome is/was at Version 74.0.3729.169 (Official Build) (64-bit)

@jasongrout
Copy link
Contributor

I think this is part of an ongoing discussion of downloading (#6658, #6139, etc.). Let's move the conversation to #6658.

@jasongrout jasongrout added this to the Reference milestone Jun 21, 2019
@kevmk04
Copy link
Author

kevmk04 commented Jul 9, 2019

@jasongrout This bug is still active in V 1.0.1. I believe this needs to be reopened.

An html file when downloaded opens in a new tab in Chrome. The same behavior is found when trying to download an image file (.png). It appears that chrome attempts to render the file instead of downloading.

The behavior in Firefox is slightly different. When the download command is selected, firefox prompts the user that it is trying to open the file and wants to know what program to use. You get the option to save the file but it appears that JupyterLab is not forcing a download. See the image below for the message that Firefox shows. The behavior is the same for both .html and .png files. I would guess that other types of files that can be rendered by a browser would also see this issue.

image

@lock lock bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Aug 8, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

No branches or pull requests

3 participants