Hi Mizan,
NicUrl or NiceUrlFormat will only work on content Nodes. Media is a different type. Below you find a piece of code that returns the path of the media (it also includes the filename).
Code:Literal1.Text = umbraco.library.GetMedia(1331, false).Current.SelectSingleNode("//data[@alias=\"umbracoFile\"]").Value;
What I'm doing is first access the Media Item. The false paramter indicates that I only want to access the single Item. This returns an xPathNodeIterator where I retreive the Umbraco filename from.
Hope this helps,
Richard
ASP.NET and Umbraco development -
Soeteman Software