Microsoft KB Archive/260260

= BUG: Opening a Stream to a URL Produces &quot;Accessing Data Across Domains&quot; Warning Message =

Article ID: 260260

Article Last Modified on 5/8/2003

-

APPLIES TO


 * Microsoft Internet Explorer 5.0
 * Microsoft Internet Explorer 5.01
 * Microsoft Internet Explorer (Programming) 5.01 SP1
 * Microsoft Internet Explorer 5.5

-



This article was previously published under Q260260



SYMPTOMS
If safety settings on the browser prohibit accessing data on another domain, and the Open method of a stream object is called from a client's browser, then the following warning message is reported:

&quot;This page is accessing data on another domain.&quot;

The error occurs even if the source for the method references a URL on the same domain from which the page was loaded.



RESOLUTION
On the Tools menu, select Internet Options, and then select the Security settings dialog box to adjust the client browser to enable &quot;Access data sources across domains&quot; for the proper Internet zone (Internet, intranet, and so forth).



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
To reproduce this problem, insert the following code into a new ASP page and save the page on a Web server:   Repro Page for Microsoft Knowledge Base Article Q260260  Sub Send ' Upload the contents of the file to the server const adTypeBinary = 1 const adModeWrite = 2 const adModeReadWrite = 3 const adCreateOverwrite = &H4000000 dim objStream, objRecord dim strUrl, strFile

strUrl = &quot;http:// /upload/&quot; strFile = &quot;NewFile.txt&quot;

set objRecord = CreateObject(&quot;ADODB.Record&quot;) set objStream = CreateObject(&quot;ADODB.Stream&quot;) ' Open a new record object with a number of flags set objRecord.Open strUrl + strFile, &quot;&quot;, adModeReadWrite, adCreateOverwrite

objStream.Type = adTypeBinary ' The following line generates the error if safety settings on the ' machine prohibit accessing data on another domain. objStream.Open &quot;URL=&quot; + strUrl + strFile, adModeWrite objStream.LoadFromFile document.frmFile.flFileName.value

objStream.Close objRecord.Close set objStream = nothing set objRecord = nothing ' Post the form to display the image from the server, ' demonstrating that it was uploaded successfully. document.frmFile.submit End Sub    Repro code for Microsoft Knowledge Base Article Q260260  <B>Select a text file and click submit. The script on this page will copy it to the server.<BR> The script will then submit this form, viewing the file that was created on the server.</B> <BR><BR> File to upload: <INPUT type=&quot;file&quot; id=&quot;flFileName&quot; name=&quot;flFileName&quot;> <BR><BR> <INPUT type=&quot;button&quot; id=&quot;btnSubmit&quot; name=&quot;btnSubmit&quot; value=&quot;Submit File&quot; onclick=&quot;Send&quot;> </FORM> </BODY> </HTML> NOTE: If you do not follow the instructions in the &quot;Resolution&quot; section earlier in this article, this page fails.

Additional query words: stream record stops responding freeze crash crashes

Keywords: kbbug kbpending KB260260

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.