|
|
 Rank: Addict
Joined: 7/19/2006 Posts: 815 Location: Århus, Denmark
|
Hi everyone. A client just asked med to figure out where certain files are located on their solution. They have a HUGE media library, and alle I've got to go after is the url to the file: /media/53278/the-file-name.pdf Is there any clever way to locate to parent folder path of this file? Maybe by going straight to the database?
|
|
 Rank: Aficionado
Joined: 4/3/2008 Posts: 103 Location: The Netherlands
|
Hi Morten, With the query below I can find my Company Logo in the Database (not a huge structure) but it's similar to your request I think. Code:Select UmbracoNode.ParentId as ParentNode, UmbracoNode.Id as Node from UmbracoNode INNER JOIN cmsPropertyData on UmbracoNode.Id = cmsPropertyData.ContentNodeId where dataNvarchar = '/media/190/soetemansoftwarelogo.jpg' Hope this helps. Richard
ASP.NET and Umbraco development - Soeteman Software
|
|
 Rank: Umbracoholic
Joined: 7/20/2006 Posts: 1,076 Location: Charleston, West Virginia, United States
|
Morten, The number in the path relates to a property in the database. cmsPropertyData table id field to be exact. This record should have a reference to a contentNodeId. From there, you can get the path from the node using either GetMedia, or a direct call to umbracoNode table with the path and parent fields. Hope this helps
• 2007/2008 MVP • 2008/2009 MVP • Certified • Licensing • Support • Development • Hosting •
|
|
 Rank: Umbracoholic
Joined: 7/20/2006 Posts: 1,076 Location: Charleston, West Virginia, United States
|
Or do what richard says.. Same idea, slight differencein approach.
• 2007/2008 MVP • 2008/2009 MVP • Certified • Licensing • Support • Development • Hosting •
|
|
 Rank: Addict
Joined: 7/19/2006 Posts: 815 Location: Århus, Denmark
|
Ok, I have tried the approaches, and no records are returned. I'm guessing this means that they have deleted the folder containing the files that they are looking for. Is that a valid conclusion? I also tried this: select * from cmscontentxml where [xml] like '%nodeTypeAlias="File%' and [xml] like '%/media/53278/lf-elf_no_200.pdf%' which didn't return anything either.
|
|
 Rank: Umbracoholic
Joined: 7/20/2006 Posts: 1,076 Location: Charleston, West Virginia, United States
|
Yes, they could have deleted the umbraco node with the data, and the file still exist (personal annoyance of mine too). The latter select nodeTypeAlias should be umbracoFile if I am correct. If they deleted the node tree, hopefully you have a backup of the database that has those entries, and can extract them out, and restore them to the other database.
• 2007/2008 MVP • 2008/2009 MVP • Certified • Licensing • Support • Development • Hosting •
|
|
 Rank: Aficionado
Joined: 4/3/2008 Posts: 103 Location: The Netherlands
|
Quote:Is that a valid conclusion? Must be otherwise it was in the result
ASP.NET and Umbraco development - Soeteman Software
|
|
 Rank: Addict
Joined: 7/19/2006 Posts: 815 Location: Århus, Denmark
|
neehouse wrote:If they deleted the node tree, hopefully you have a backup of the database that has those entries, and can extract them out, and restore them to the other database. They are self hosted, so I don't know if they have backups. They'll just have to do some manual reentering of the data.
|
|
|
Guest |