DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Thu, 9 Aug 2007 15:44:01 -0700,    posted on: microsoft.public.dotnet.framework        back       

Thread Index
  1    Simona
          2    Jon Skeet [C# MVP]
                 3    Simona
                 4    Jon Skeet [C# MVP]
                        5    Simona


Response.BinaryWrite and IE7   
I am trying to display a tiff image in the browsers. I have AlternaTIFF 
activex control installed. 
I am using the following  code
            FileStream fs = File.Open(@"c:\temp\test.tif",FileMode.Open);
            long len = fs.Length;
            byte[] myFile = new byte[len];
            fs.Read(myFile, 0, (int)len);
            fs.Close();
            Response.ContentType = "application/x-alternatiff";
            Response.BinaryWrite(myFile);
            Response.Flush();
            Response.Close();
that works just fine on IE6. However, on IE7 I am getting "A runtime error 
occured. LIne: 1, Error: Invalid character" and in debugger it stopes with 
"Microsoft JScript runtime error: Object expected". 
If I look under Script Explorer I can see res://mshtml.dll/objectembed.js 
which I am assuming in generating the JScript error. 

Are there any settings or permissions with IE7 that would generate my error? 
Are there any work arounds? 

Thank you.
Date:Thu, 9 Aug 2007 15:44:01 -0700   Author:  

Re: Response.BinaryWrite and IE7   
Simona  wrote:

> I am trying to display a tiff image in the browsers. I have AlternaTIFF 
> activex control installed. 
> I am using the following  code
>             FileStream fs = File.Open(@"c:\temp\test.tif",FileMode.Open);
>             long len = fs.Length;
>             byte[] myFile = new byte[len];
>             fs.Read(myFile, 0, (int)len);
>             fs.Close();
>             Response.ContentType = "application/x-alternatiff";
>             Response.BinaryWrite(myFile);
>             Response.Flush();
>             Response.Close();
> that works just fine on IE6. However, on IE7 I am getting "A runtime error 
> occured. LIne: 1, Error: Invalid character" and in debugger it stopes with 
> "Microsoft JScript runtime error: Object expected". 
> If I look under Script Explorer I can see res://mshtml.dll/objectembed.js 
> which I am assuming in generating the JScript error. 
> 
> Are there any settings or permissions with IE7 that would generate my error? 
> Are there any work arounds? 


A quick Google search found this:

http://www.alternatiff.com/faq.html

Just search for "invalid character" on the page.

-- 
Jon Skeet - 
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Date:Thu, 9 Aug 2007 23:55:37 +0100   Author:  

Re: Response.BinaryWrite and IE7   
Thank you for the link. Unchecking the "Allow active content to run in files 
on My Computer " gets rid of the java script error. My main problem at this 
point is displaying the image.
We are getting the tiff files from a third party using a web service. We 
don't want to store the images since we can get them on demand. We cannot ask 
the user of our web application to change their registry and there is no zone 
to add to the trusted sites since the image is in memory.

Is there any other way I can display the tiff file in the browser?

"Jon Skeet [C# MVP]" wrote:


> Simona  wrote:
> > I am trying to display a tiff image in the browsers. I have AlternaTIFF 
> > activex control installed. 
> > I am using the following  code
> >             FileStream fs = File.Open(@"c:\temp\test.tif",FileMode.Open);
> >             long len = fs.Length;
> >             byte[] myFile = new byte[len];
> >             fs.Read(myFile, 0, (int)len);
> >             fs.Close();
> >             Response.ContentType = "application/x-alternatiff";
> >             Response.BinaryWrite(myFile);
> >             Response.Flush();
> >             Response.Close();
> > that works just fine on IE6. However, on IE7 I am getting "A runtime error 
> > occured. LIne: 1, Error: Invalid character" and in debugger it stopes with 
> > "Microsoft JScript runtime error: Object expected". 
> > If I look under Script Explorer I can see res://mshtml.dll/objectembed.js 
> > which I am assuming in generating the JScript error. 
> > 
> > Are there any settings or permissions with IE7 that would generate my error? 
> > Are there any work arounds? 
> 
> A quick Google search found this:
> 
> http://www.alternatiff.com/faq.html
> 
> Just search for "invalid character" on the page.
> 
> -- 
> Jon Skeet - 
> http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
> If replying to the group, please do not mail me too
> 
Date:Thu, 9 Aug 2007 16:22:03 -0700   Author:  

Re: Response.BinaryWrite and IE7   
Simona  wrote:

> Thank you for the link. Unchecking the "Allow active content to run in files 
> on My Computer " gets rid of the java script error. My main problem at this 
> point is displaying the image.
> We are getting the tiff files from a third party using a web service. We 
> don't want to store the images since we can get them on demand. We cannot ask 
> the user of our web application to change their registry and there is no zone 
> to add to the trusted sites since the image is in memory.
> 
> Is there any other way I can display the tiff file in the browser?


It looked from the FAQ as if it only affected one particular type of 
tiff - although I didn't look in detail.

Do you *have* to show it as a tiff? Could you convert the tiff on the 
fly into another image format?

-- 
Jon Skeet - 
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Date:Fri, 10 Aug 2007 06:49:07 +0100   Author:  

Re: Response.BinaryWrite and IE7   
I read the whole FAQ. I changed the registry but nothing seems to work for me 
on IE7 even on I have the file on the disk and not just in memory.
I wasn't thinking about conversion but it sounds like my only chance at this 
point. I am concerned a little bit about performance but I will definitely 
look into conversion.

Thank you for your help

"Jon Skeet [C# MVP]" wrote:


> Simona  wrote:
> > Thank you for the link. Unchecking the "Allow active content to run in files 
> > on My Computer " gets rid of the java script error. My main problem at this 
> > point is displaying the image.
> > We are getting the tiff files from a third party using a web service. We 
> > don't want to store the images since we can get them on demand. We cannot ask 
> > the user of our web application to change their registry and there is no zone 
> > to add to the trusted sites since the image is in memory.
> > 
> > Is there any other way I can display the tiff file in the browser?
> 
> It looked from the FAQ as if it only affected one particular type of 
> tiff - although I didn't look in detail.
> 
> Do you *have* to show it as a tiff? Could you convert the tiff on the 
> fly into another image format?
> 
> -- 
> Jon Skeet - 
> http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
> If replying to the group, please do not mail me too
> 
Date:Fri, 10 Aug 2007 07:14:00 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us