Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Portal directoryPortal directory
Previous
 
Next
New Post
9/15/2008 2:27 PM
 

Hi,

I am sorry for the noob question, but I am trying to create a module that references a directory in the current portal.  I have tried to using several of the Portal variables but haven't  found one that works. My development site is http://localhost/DNN48/test/.  It is a child portal.  The address I am looking for is http://localhost/DNN48/Portals/2/Images/myImage.jpg.  So I tried assembling a path from some of the variables in the UserControl class. 

PortalAlias.HttpAlias - /localhost/DNN48/test - That would work fine for the main portal, but child portals don't seem to like it

PortalSettings.HomeDirectory - /DNN48/Portals/2/ - would be fine except I need the server name

All the other path type members of the Portal classes seem to be local hard drive oriented.  Do you have to parse these string and know where the base of the website is?  I am not seeing a clear way to know that.

Any help would be greatly appreciated.

Richard

 
New Post
9/15/2008 4:04 PM
 

What I am trying to do is get all of the image files from a directory in the portal.  Now I am realizing that the way in which I am going about this will not enable me to get the files if the portal is set up to save all of the files in the database.  Is there a unified way to get all of the fies from a directory on a a portal?

Thanks,

Richard

 
New Post
9/15/2008 4:23 PM
 

Does this help?

 Dim strSourcePath As String = Server.MapPath("~/DesktopModules/MyModule/MyFolder")

 Dim filterFolderName As String = "MySubFolder"

 FileSystemUtils.AddFolder(PortalSettings, strSourcePath, filterFolderName, FolderController.StorageLocationTypes.InsecureFileSystem)
 

This would create \DesktopMudules\MyModule\MyFolder\MySubFolder

I have not tried it but assume you could replace DesktopModules with Portals etc ...



 
New Post
9/15/2008 4:40 PM
 

Thank you for your response.  I can actually get to the files programmatically.  I am trying to send the filenames to the Silverlight app so that it can grab them.  So I am needing the http path of the files.

Richard

 
New Post
9/16/2008 10:13 AM
 

I have found that if I am in the root portal (Portal 0) than I can just add "/Portals/0/' and that will work.  If I am in any other portal then take the http alias and search backwards to find the first / and take everything before that and add '/Portals/PortalID/' then that works. 

I believe that DNN does not allow sub/subportals.  I tried adding one and it didn't loke that too much.  Does anybody know of any reason why this wouldn't work?

Thanks,

Richard

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Portal directoryPortal directory


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out