evilom
evilom

Reputation: 583

absolute path to relative path outside the ASP.NET app folder

For example my app is in C:\Root\App then I have my images from C:\Image folder

C:\Image is configured in the web.config and getting the absolute path of this folder will result in file:////C://Image

is there a way to convert this to ../../Image that is relative to C:\Root\App folder?

or is there anyway to display images outside the app folder in a tag? ..because

Upvotes: 1

Views: 940

Answers (1)

Luaan
Luaan

Reputation: 63732

Basically, you've got three ways:

  1. Use a file system solution - Create a hardlink in your application directory that points to C:\Image. Everything should work just fine.
  2. Add a new virtual directory ("Images") in your application directory, that points to C:\Image.
  3. Create your own HttpModule / HttpHandler to server the files from your C:\Image directory.

I can write more about any of these solutions if you'd like.

Upvotes: 1

Related Questions