Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Is it possible to create virtual directories?
miro
#1 Posted : Saturday, November 17, 2007 6:04:33 PM(UTC)
Groups: Member
Joined: 11/17/2007(UTC)
Posts: 4
Location: US

Say I install/register a web application At C:\Program Files\MyApp\Web (which results in http://localhost:port).

In an IIS installation, I can go into Internet Services Manager and create a virtual directory under the application root, say for example a "documents" and have it point to C:\Documents. The end result being http://localhost:port/documents

This wouldn't be for directory browsing (I'm not that crazy :-) ), it would be for streaming audio files and/or viewing images.

Is this possible with UltiDev Cassini? I couldn't find this in the documentation, but I am thinking of creating a package deployment for an application I have written and this seems like a really good solution if the above is possible...

Thanks in advance...!
Ultidev Team
#2 Posted : Sunday, November 18, 2007 7:31:03 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi there.

UltiDev Cassini does not support virtual folders, but if you are willing to code a little bit to work around the problem, there may be a solution. Depending how you access files in the the virtual sub-folder, you could try one of these two approaches:

1. In the case your app generates links to the files in the "documents" sub-folder, you could register second application pointing to the "C:\Documents". You could either use predetermined port number (4321, for example) so all links would be like http://machinename:4321, or you could register second application with system-determined port and then use Cassini Configuration Web Service to find the port assigned to the "Documents" application.

2. In case you open and read files from "c:\documents" programmatically, and all you need virtual folder for is to create easy to use access rights management point and to use MapPath() function, then you could simply open & read files programmatically because unlike IIS, Cassini runs under powerful Local System account that allows access to most files on the file system. As long as you know the path to the file, under Cassini you can just open the file and do whatever you need with it.

Please let us know if this information has helped.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
miro
#3 Posted : Sunday, November 18, 2007 4:54:45 PM(UTC)
Groups: Member
Joined: 11/17/2007(UTC)
Posts: 4
Location: US

Ultidev Team wrote:
Hi there.

UltiDev Cassini does not support virtual folders, but if you are willing to code a little bit to work around the problem, there may be a solution. Depending how you access files in the the virtual sub-folder, you could try one of these two approaches:

1. In the case your app generates links to the files in the "documents" sub-folder, you could register second application pointing to the "C:\Documents". You could either use predetermined port number (4321, for example) so all links would be like http://machinename:4321, or you could register second application with system-determined port and then use Cassini Configuration Web Service to find the port assigned to the "Documents" application.

2. In case you open and read files from "c:\documents" programmatically, and all you need virtual folder for is to create easy to use access rights management point and to use MapPath() function, then you could simply open & read files programmatically because unlike IIS, Cassini runs under powerful Local System account that allows access to most files on the file system. As long as you know the path to the file, under Cassini you can just open the file and do whatever you need with it.

Please let us know if this information has helped.

Best regards,
UltiDev Team.


Thanks, this sounds like a good approach based on what I am doing. It would require some fairly minor re-coding in my application, but nothing too extensive. #1 is definitely the solution I need, I am already utilizing #2 for getting file information... #1 allows me to stream content through an embedded flash player.

Is it fairly easy to access/modify the Cassini application instances programmatically once it has been installed? I am writing a small winforms application to configure the "virtual folder" and I would like to be able to control the Cassini instances I have installed, to eliminate extra steps on the user's end.

For example, the end user may want to change the folder that files are located in, I would want to update the second application's root directory, and also potentially allow the user to change the port themselves. Ideally if I can give the end user a single interface for maintaining the application it would be a huge benefit.

Thanks again for your help!
Ultidev Team
#4 Posted : Sunday, November 18, 2007 6:20:36 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Yes, it is very easy to modify your application registration record with UltiDev Cassini using our .NET Cassini Configuration API. Most likely you will nee to do this:
1. Load Cassini metabase:
Code:
Metabase metabase = Metabase.Load();

2. Find your application record:
Code:
ApplicationEntry app = metabase.FindApplication(<you app GUID>);

3. Modify physical location of the folder:
Code:
app.PhysicalPath = @"c:\Documents";

4. Save metabase changes:
Code:
metabase.Save();

This last line will save metabase and will make Cassini reload all applications.

To use Cassini Configuration API, add reference to the "%ProgramFiles%\UltiDev\Cassini Web Server for ASP.NET 2.0\UltiDevCassiniServerConfiguration.dll" assembly.

Please let us know id this has helped.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Guest
#5 Posted : Tuesday, March 8, 2016 3:42:47 AM(UTC)
Groups:

Message was deleted by a Moderator.
Guest
#6 Posted : Tuesday, September 18, 2018 7:28:29 PM(UTC)
Groups:

Message was deleted by a Moderator.
Rss Feed  Atom Feed
Users browsing this topic
Guest (5)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.