Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm trying to redirect to the media url, but using the code blow, results in the full url concatenated by the size of the media.
So for example the url returns /media/123/example.pdfpdf4000
XPathNodeIterator xName = umbraco.library.GetMedia(Convert.ToInt32(pdfid), false; string url = xName.Current.Value; Response.Redirect("~/"+ url);
Hi Seena
Your code above is returning all the media information
Just wondering if you might be better using the following:
Media file = new Media(Convert.ToInt32(pdfid));string url = file.getProperty("umbracoFile").Value.ToString();Response.Redirect("~/"+ url);
Hope this helps.
Nigel
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
GetMedia does not return the correct url
I'm trying to redirect to the media url, but using the code blow, results in the full url concatenated by the size of the media.
So for example the url returns /media/123/example.pdfpdf4000
What is happening?
Hi Seena
Your code above is returning all the media information
Just wondering if you might be better using the following:
Hope this helps.
Nigel
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.