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?
Downloading a pdf using media picker
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.
@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?
Hi Mark
would
yield the Url of the pdf file item?
It depends on what property editor type the coverageDocumentPdf property is...
If it's a media picker configured to pick a single item, then by using the above, by using
regards
Marc
Thanks Marc
Thought it would be straight forward just could not work it out.
is working on a reply...