Score:0

How can we directly display/download attached document on Media path

us flag

I am trying to directly display/download the attached file when the Media link is reached. Main reason behind this is to avoid providing file path directly.

For example: if a user is visiting www.dummy.com/media/redcar_brochure/ then they should be able to view the www.dummy.com/sites/default/files/2021-10/redcar_brochure.pdf file directly in the attached media page. This will avoid clicking the file link again after going into the media page.

I tried changing the display setting for the document under media display but that is not having a way to directly view/download the file.

Is there any other way we can achieve this, spent some time with media_alias_display https://www.drupal.org/project/media_alias_display module but no luck.

ru flag
Try https://www.drupal.org/project/media_entity_download
Regokonda avatar
us flag
@Hudri Gave it a quick try, fits the purpose +1 for the answer, will play around to see if there is anything that needs to be addressed
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.