After updating to the 2.18 "Download as file" no longer works as it used to. For example if I right-click on mp3 or any type of video file instead of download dialog box it opens (or tries to open) in the browser. This way audio or video file starts playing in the browser instead of downloading.
I know, it is not a big deal for me. I can still go File -> Save page as... in a web browser, and save the file this way, but some users of the website got confused by change in behavior and don't know how to download the file.
Is it possible to rectify that?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nhck’s picture

Dear gd1008,

thank you for reporting this and helping to make webfm better. There is no such option in the webfm settings. so you will need to explain a bit more. We have an option to open the file in a new browser window - if your browser supports playing those files instead of downloading them then it will play them, no?

Thank you.

gintass’s picture

FileSize
30.96 KB

Thank you for your response.
Yes, there is such an option, not in settings or configuration, but when you right-click on any file. I'm attaching the screen-shot in which you can see all options that are available. 5th option from the top says "Download as file". Why would we need this option if it behaved as you described here - "...if your browser supports playing those files instead of downloading them then it will play them"? No, it should not play even if browser does support this type of file. It should open the download dialog box. That is the whole point of this option and that is how it used to behave prior to the update. For example this option used to open download dialog box for mp3 files, but now they just start playing in the browser. I can achieve the same by simply left clicking on the file. I don't need to select any options to play mp3 in the browser.

nhck’s picture

Oh I understand. I made a mistake there.

For you as a quick fix: In line 2649 in webfm.module it says:

 if (_webfm_attach_new_window()) {

but you should it should really be:

 if (_webfm_attach_new_window() == FALSE) {

In general this poses the question: Should there be two different Option: One to force download and one to open the attachment in a new window?

nhck’s picture

Version: 6.x-2.18 » 6.x-2.x-dev
Status: Active » Fixed

Issue #1445482 by gd1008: Fixed 'Download as file" no longer works.

This is in git and should be in the dev version as soon as it is rebuild.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

roball’s picture

Status: Closed (fixed) » Active

In general this poses the question: Should there be two different Option: One to force download and one to open the attachment in a new window?

Yes, there should. Also a feature that used to work in older WebFM versions is broken in the current release: If you link to a file via /webfm_send/[FID]/1 the file was sent to the browser as a binary download - instead of opening it directly when the link is just /webfm_send/[FID] (without the "/1" on the end).

Did you fix this bug with the solution to this issue?

nhck’s picture

Status: Active » Needs review

roball, good to hear from you . Actually that is what I was referring to. You should try the dev-version - I have split this into two options.

roball’s picture

Status: Needs review » Needs work
FileSize
7.87 KB
7.84 KB

Good to know nhck you are currently working on this.

However, the "Attachment Opening features added" part of commit a90bcf5 needs to be reverted! It breaks a functionality that has been in WebFM all the time:

Regardless of the options set in the WebFM settings, you always have 2 choices how to get a file attached to a node (see attached screenshots):

1. If you hover on the icon left to the file name, you will see "Download ...". Clicking on it ALWAYS forced a binary download! This used to correspond to the URL webfm_send/[FID]/1 (as mentioned in my above post).

2. If you hover on the file name, you will see "Open ...". Clicking on it opened the file in the browser, either in a new or the same window - as specified in the settings. This used to correspond to the URL webfm_send/[FID].

Now both links are the same, and the link has changed. This also breaks existing links using the old scheme.

nhck’s picture

Status: Needs work » Needs review

Roball, I commited as you suggested. There was a mistake in the code.

roball’s picture

Status: Needs review » Needs work

Web File Manager 6.x-2.x-dev (2012-Apr-06) still does not solve this issue for me. As you can see at for example here, both the Download and Open links are the same (now .../[FID]/3), while the Download link should be .../[FID]/1 and the Open link .../[FID].

nhck’s picture

Status: Needs work » Needs review

Oops, I forgot to push ^^

roball’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, finally it works again :-)

nhck’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.