i am getting an error the type or namespace media cannot be found... what references or 'using' statements am i missing??? i am so NEW to this -- sorry
okay, so Visual Studio has lots of tricks i have to learn :) I was able to fix that error by simply hitting 'Ctrl .' and it gave me a list of refrences that i 'MIGHT' be trying to use but have not included... so i simply clicked on the one i wanted and VIOLA -- everything passess error tests :)
How to get a path for file in media
Hi
I need to figure out how to get a path to my media file..
I have upload some pdf and not I whant to create a link in page but it ... In C#
have some code
[quote]
Media nm = new Media(mediaNumber); // now I have a media but I need a pdf path
[/quote]
I found somwhere somthing like
string imagePath = nm.getProperty("umbracoFile").Value.ToString();
is this going to give me that ????
Hi lpastor,
[code]string imagePath = nm.getProperty("umbracoFile").Value.ToString();[/code]
will get the image path in /media/id/filename.ext format
Regards,
/Dirk
thanks chief =d>
One question ..
is there a way to found a full path of image ..
as you sad I'm going to get
/media/id/filename.ext format
but I need a full path c:\inetpubz\umbraco303\media\id\filename.ext format
because I want to be sure is this file exist on drive?
Hi,
Media files are always stored on disk! in .net, use Server.MapPath() to get filename on disk
Regards,
/Dirk
i am getting an error the type or namespace media cannot be found... what references or 'using' statements am i missing??? i am so NEW to this -- sorry
mediaId)
{
// Get the path to the image
);
);
.Empty;
(nodes.MoveNext())
{
path = nodes.Current.Value;
;
}
path;
okay, so Visual Studio has lots of tricks i have to learn :) I was able to fix that error by simply hitting 'Ctrl .' and it gave me a list of refrences that i 'MIGHT' be trying to use but have not included... so i simply clicked on the one i wanted and VIOLA -- everything passess error tests :)
this is gonna be a fun winter :)
is working on a reply...