General discussion

Locked

Include file from other server

By munrrob ·
Is it possible to include a file from another server in html? I have typed <!-- #include file="http://Nlg-info/PESE/PESE.asp" --> 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.

This conversation is currently closed to new comments.

13 total posts (Page 1 of 2)   01 | 02   Next
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by techrep In reply to Include file from other s ...

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.

Collapse -

by munrrob In reply to

Poster rated this answer.

Collapse -

by munrrob In reply to Include file from other s ...

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.

Collapse -

by munrrob In reply to Include file from other s ...

Point value changed by question poster.

Collapse -

by mvegas In reply to Include file from other s ...

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 <!--#include virtual="/pese/pese.asp"-->. 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.

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

Collapse -

by munrrob In reply to

Poster rated this answer.

Collapse -

by Paulvs1_ In reply to Include file from other s ...

how do you get a folder from a nother server i have tryed to do that

Collapse -

by Paulvs1_ In reply to

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.

Collapse -

by munrrob In reply to

Poster rated this answer.

Collapse -

by munrrob In reply to Include file from other s ...

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?

Back to Web Development Forum
13 total posts (Page 1 of 2)   01 | 02   Next

Related Discussions

Related Forums