473,387 Members | 1,561 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

disable to dsiplay xml file on web browser from across domain

How do I disable to show xml file content on web browser from across domain.
I know we can have some sort of enbcription on the xml file content.
I also know that we can use authentication to control the display of xml file.

However, I want to assume the user is authenticated in the directory where I
have the haha.xml file. Yet, the user would not be able to see the content of
the xml file as below

ie) When some one type http://mywebsite.com/haha.xml and it would not show
the content of the xml file on the web browser.

Please help and thanks.

Ray
Nov 22 '05 #1
1 1557
Ray,

I'm sure there is a better way, but one approach is to write an
HttpHandler that will "ignore" the request. You can implement the
desired behavior within the handler. For example, you could redirect
the user to another page or return blank HTML.

Follow the steps below for an example:

1) Add the file extension .xml to the Application Extensions list in
IIS. (Using the IIS Manager, select the virtual directory and go to
Properties | Virtual Directory tab | Configuration... | Mappings tab.)

2) Compile the sample code to as a dll and name the file
IgnoreHttpHandlers.dll:

using System.Web;

namespace IgnoreHttpHandlers
{
public class Xml : IHttpHandler
{
public bool IsReusable { get{ return true; } }

public void ProcessRequest(System.Web.HttpContext context)
{
// Return blank HTML.
}
}
}

3) Copy IgnoreHttpHandlers.dll to the bin directory of the virtual
application.

4) Add the following to the web.config:

<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="*.xml"
type="IgnoreHttpHandlers.Xml,IgnoreHttpHandlers" />
</httpHandlers>
</system.web>
</configuration>

This sample will return a blank HTML document instead of the Xml
source for any files with an extension of .XML. Again, this is one
approach. There's probably an easier, better way.

HTH

-KIRBY
--
Kirby Turner, MCSD, MCAD
www.whitepeaksoftware.com

On Mon, 6 Sep 2004 21:17:02 -0700, "Raymond Cheung" <Raymond
Ch****@discussions.microsoft.com> wrote:
How do I disable to show xml file content on web browser from across domain.
I know we can have some sort of enbcription on the xml file content.
I also know that we can use authentication to control the display of xml file.

However, I want to assume the user is authenticated in the directory where I
have the haha.xml file. Yet, the user would not be able to see the content of
the xml file as below

ie) When some one type http://mywebsite.com/haha.xml and it would not show
the content of the xml file on the web browser.

Please help and thanks.

Ray


Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: kj | last post by:
Is there any way to disable text selection in a web page (or at least render it invisible to the user)? If there is a way to control how selected text and its background are rendered, then the...
1
by: Raymond Cheung | last post by:
How do I disable to show xml file content on web browser from across domain. I know we can have some sort of enbcription on the xml file content. I also know that we can use authentication to...
12
by: Ken | last post by:
How can I determine a image file size before uploading it? I would like to make sure the size is under a maximum before taking the time to upload it. If I have to upload the file before...
3
by: Divya | last post by:
Hello, I am trying to copy a file from one domain to another. I have the username and password of the destination domain. I tried a few approaches - 1. Using the Impersonator Class -...
7
by: Doug | last post by:
An ASP.NET session cookie set on "www.mydomain.com" can not be accessed on "search.mydomain.com"; hence, a new session and cookie are being created on every sub-domain. This is occuring because...
1
by: Bob | last post by:
Does anyone know how to disable javascript in the new Netscape 8 -- for off line testing (like can be done readily with the current MSIE, Firefox or Opera browsers) ? When I try tools -> options...
19
by: RedDevilDan | last post by:
I am working on a Memory Footprint Reduction project. I came across an idea to disable all printf statements so that less memory is required. In addition, when there is no single printf statement,...
1
by: ozgur uksal | last post by:
hi, Is there any way to upload data across domains? In other words, assume you own two domains on the same server, and the first domain, that your client visits to upload data, is going to be...
2
by: yong321 | last post by:
My question is not about Javascript programming. I'd like to use a browser, either IE or Firefox or whatever, that allows me to disable a specific Javascript function but not disable Javascript...
16
by: Stevo | last post by:
I'm guessing this is a laughably obvious answer to many here, but it's not to me (and I don't have a server or any knowledge of PHP to be able to try it). It's not strictly a PHP question, but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.