Help file outside the website directory

How to link to a file outside the root directory of a website?

For example, my site is located at C: \ dev \ TestSite. I am using ASP.NET with XSP. Webapp will be deployed to Apache using mod_mono. I have images in C: \ images and I would like to do this:

<img src="C:\images\logo.gif"/>
+3
source share
4 answers

Tag imgtag srcwill be sent to customer. You need to specify these paths relative to your document root. It is best to configure a virtual folder (in IIS, alias is the equivalent of apache) to point to the path c:\images, and then change the specified tag srcas follows

<img src="/images/logo.gif" />

apache, httpd.conf. :

Alias /images c:/images

docs http://httpd.apache.org/docs/2.0/mod/mod_alias.html#alias

+4

, . IIS / .

- IIS. , , C: .

+2

HTML- . HTML- - ( , CSS, javascript ..). , , .

EDIT:

apache conf.

Alias /images "C:/Images"

- .

+2

, C:\images\logo.gif - , .

src html (.. Internet Explorer). -. , -, . , ASP.NET, , - -..., .

, , spring - :

  • ASP.NET( ) , html, , , , .

  • ASP.NET( System.IO) C:\images\logo.gif , - , , , , .

, , , , , , , , ASP.NET.

C:\Images , /ImageCentral - , , , , , . DaveSwersky, , , , -, .

.

+2

Source: https://habr.com/ru/post/1754860/


All Articles