The subject says it all but just to keep this into context - if the node/1/attachment link points to a text or an image file then instead of the 'normal' behavior of browsers rendering the view for them inside the browser these txt/image files get downloaded.

We found it a bit annoying so worked on a fix to maintain this original behavior while still working with this module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lirantal’s picture

Status: Active » Needs review
FileSize
1.17 KB

Suggested fix for this issue.

lirantal’s picture

Actually the above will cause the file to be downloaded as 'attachment' so it's not a proper fix.
This new patch will detect if the file is of mime type for plain text/pdf and will open in the browser, otherwise it will force a download (with the correct file name).

rupl’s picture

Status: Needs review » Postponed (maintainer needs more info)

Hey there, thanks for the report accompanied by a patch! Unfortunately I cannot detect any change in the module's behavior with the patch applied. The header info doesn't change at all when I check in my browser devtools, nor does a PDF load automatically in the browser window.

Could you provide me with some steps to reproduce the outcome you expect?

lirantal’s picture

You're welcome :)

It was my mistake to mention the PDF example as that was not taken care of but rather what should open in the browser is a text file or an image. So try uploading a readme.txt or an image.jpg and then fetch it with the attachment links URL and they should open inside the browser instead of being downloaded.

apaderno’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (outdated)

I am closing this issue, as Drupal 6 is now not supported.