Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

Getting file path in the object model

  Asked By: Angie Erickson         Date: Nov 17, 2008      Category: Sharepoint      Views: 274
 

I have a .jpg file stored in the /TEMPLATE/IMAGES/ folder in the 12 Hive.
In the object model, I need to get the file path to this .jpg. I
attempted to use @"/_layouts/IMAGES/file.jpg" and the file could not be
found.

Tagged:              

 

2 Answers Found

 
Answer #1       Answered By: Donta Kirkland          Answered On: Nov 17, 2008       

Not sure this helps or not.

I have images in this folder  and I can use them for the site logo by
using /_layouts/images/xxx format by using the browser.

Is your code running a web context? ie, it is not a standalone
application, right? since _layouts is a virtual folder in IIS.

 
Answer #2       Answered By: Cade Velazquez          Answered On: Nov 17, 2008       

string imagesPath =
Microsoft.SharePoint.Utilities.SPUtility.GetGenericSetupPath("TEMPLATE/I
MAGES");

 
Didn't find what you were looking for? Find more on Getting file path in the object model Or get search suggestion and latest updates.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].