I can not seem to get this to work. I am new to Umbraco using Umbraco Cloud v8 and this code is in a partial.
I would like to be able to click on the item name and download the pdf. The pdf has been uploaded using the media picker and the item displayed on the page.
@foreach (var item in selection)
{
var typedMediaPickerSingle = item.Value<IPublishedContent>("coverageLogo");
if (typedMediaPickerSingle != null)
{
<p class="literature-container">
<a href=" @item.Url("coverageDocumentPdf")">@item.Name</a>
</p>
<p class = "literature-image"><img [email protected] /> </p>
}
}
@item.Url(“coverageDocumentPdf”) gives the path /coverage/pdfcoveragetest/ and @item.Value(“coverageDocumentPdf”) gives Umbraco.web.pubishedModels.File.
How do I display the link to download the file /xxxx/xxxx/pdfname.pdf?
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/100088-downloading-a-pdf-using-media-picker