Discussion Locked

Include file from other server

0 helpful
13 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Is it possible to include a file from another server in html? I have typed is this the correct code?

I cannot have the files together as we are developing in asp.net while the intranet server does not have hte framework loaded.

13 replies

by techrep

What you're doing won't work.

You have to use the fully qualified share name to identify the location of the server, not the http location. For example:

This doesn't work:
#include file="http://www.mysite.com/myinclude.asp"

This will work:
#include file="\\thesharename\myinclude.asp"

In this case the server needs to be visible to your computer.

by munrrob

Have tried the solution but am now getting the following error:

Active Server Pages error 'ASP 0130'

Invalid File attribute

/information/Search.asp, line 2

File attribute '\\pese\pese.asp' cannot start with forward slash or back slash.

by mvegas

First of all, you might not have meant to say it but details are important here =O) - but you cannot include any file within a .html document. It has to be a .asp page.

Second of all, if you're going to start your file name with a "/" then you have to use "virtual." So your include would look like . YOu can only use ...include file...if the file is within the root directory. That is why the error message says File attribute cannot start with a forward slash. You must change it to virtual.

This should get you started in the right direction.

*************************************************
Comment from munrrob on 08/02/04 :
Have tried the solution but am now getting the following error:

Active Server Pages error 'ASP 0130'

Invalid File attribute

/information/Search.asp, line 2

File attribute '\\pese\pese.asp' cannot start with forward slash or back slash.

*************************************************

by paulvs1_

What you're doing won't work.

You have to use the fully qualified share name to identify the location of the server, not the http location. For example:

This doesn't work:
#include file="http://www.mysite.com/myinclude.asp"

This will work:
#include file="\\thesharename\myinclude.asp"

In this case the server needs to be visible to your computer.

by munrrob

I have tried both these solutions with no success. The problem is that the file lies on another server with the .NET framework loaded. I need to know how to include the file on the other server, i.e., how do I reference the server?

by harun

include file not work html. This is Server Side Include Commands. You can use shtml extension.
Reference Address : http://www.w3.org/Jigsaw/Doc/User/SSI.html

If it is possible use asp extension and server.execute("Nlg-info/PESE/PESE.asp"), server.transfer("Nlg-info/PESE/PESE.asp") command.

You can use virtual path for upper directory . Example: "../PESE/PESE.asp"
And you can debug and view this address server.mappath("../PESE/PESE.asp") command

or use javascript command.
Example:
window.location = "http://Nlg-info/PESE/PESE.asp"

good luck..

This discussion is closed to new replies.