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
Hoping someone can help - I'm trying to get a media item, but only have its url, no id. Is it possible? I'm working on 4.7.1.
I don't want to use xslt, or direct db queries. Hoping for a nice clear c# solution...
cheers
Nathan
Hi Nathan,
I'm afraid that the only way is a direct db query.
One like this: http://our.umbraco.org/forum/developers/api-questions/4284-getting-media-Id-from-path
When I was working on a similar module like Ismail I didn't find a better workaround.
Cheers,Dimitris
Thanks Dimitris, I thought as much... Will just use HttpWebRequest instead - I'm only after the file size, thought it coulde be done natively
N
If you're after the size, I think FileInfo will be faster. Test it and see what's better for you.
D
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
Get media item without Id
Hoping someone can help - I'm trying to get a media item, but only have its url, no id. Is it possible? I'm working on 4.7.1.
I don't want to use xslt, or direct db queries. Hoping for a nice clear c# solution...
cheers
Nathan
Hi Nathan,
I'm afraid that the only way is a direct db query.
One like this: http://our.umbraco.org/forum/developers/api-questions/4284-getting-media-Id-from-path
When I was working on a similar module like Ismail I didn't find a better workaround.
Cheers,
Dimitris
Thanks Dimitris, I thought as much... Will just use HttpWebRequest instead - I'm only after the file size, thought it coulde be done natively
N
If you're after the size, I think FileInfo will be faster. Test it and see what's better for you.
D
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.