Page 1 of 1

Error: Resource interpreted as Image but...

Posted: Sat Mar 29, 2014 5:03 am
by 9337315
I am struggling to get your demo setup on IIS. I have tried every setting of TempChartStyle and believe all have been setup correctly. I have configured IIS for asp and asp.net, and for development. I have also tried both bitmap and png output, all with the same result.
The best result I get on displaying the chart image is this response from Chrome debugger:
"Resource interpreted as Image but transferred with MIME type text/html:"
I would appreciate some direction on how to proceed!

Update--I seem to be getting somewhere by finally figuring out your registry settings (somehow were not installed in Windows 8.1!). However, your PNG filenames here are being written out with double escape characters! of course giving a Bad Request 400 error. I have verified this by trying to read them with chrome. After editing the filename they can be handled OK. I am trying to figure out a way round this. It also strikes me that you may be leaving out the correct MIME information when using your other output types. So I am getting 1 type of error with your file output and the other type with all of your other types of output. I did notice that someone previous to me had a very similar problem.

I am using the latest tchart for .net with .net 4..5.1 settings. I am dynamically creating the webchart, but I do not believe that is the problem, as your demo web site gives me exactly the same errors.

Additional information. I am having little success recompiling your source code, as it seems there is no easy way to just override your section that sets up these file names. I have to reference your 32 bit dll in my code but need to deploy the 64 bit. So in what order and with what settings are these things built? I have been working with tchart vcl for many many years (have a subscription) and with tchart for javascript with good success, but when this .net version does produce images, they are written to files with a bad (windows can open it but the browser cannot) filename so my clients cannot see any results at all as they will not display. I am very frustrated, and have put in over 100 hours trying to get a webchart to display. And I have a very unhappy client. The forms part of it works fine, but the webchart does not seem to work. I can work around things by dumping out the image myself and forcing it to the page, but then I loose your interactive features (which I am only able to see on your working on-line web demo site).

Re: Error: Resource interpreted as Image but...

Posted: Mon Mar 31, 2014 3:45 pm
by Christopher
WCantrall wrote:The forms part of it works fine, but the webchart does not seem to work. I can work around things by dumping out the image myself and forcing it to the page, but then I loose your interactive features (which I am only able to see on your working on-line web demo site).
Many apologies for the difficulties you are experiencing here. We've been able to reproduce a similar issue with TempChart="Cache" and TempChart="Httphandler", but TempChart="Session" and TempChart="File" work fine here. To work with TempChart="File" you will need to:
1) create a folder called "_chart_temp" under the file path of your web application, e.g. "D:\Program Files (x86)\Steema Software\Steema TeeChart for .NET 2014 4.1.2014.02240\Examples\TeeChartForNET\_chart_temp"
2) make sure you have the following registry settings:
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Steema Software\TeeChart.NET]
"ShareFolder"="D:\\Program Files (x86)\\Steema Software\\Steema TeeChart for .NET 2014 4.1.2014.02240\\Examples\\TeeChartForNET" //the file path of your web application
"VirtualShare"="\\TeeChartNET" //the name of your web application

using the Example ASP.NET demo with the above modifications, TempChart="File" works fine for us here, with the image files being written to the _chart_temp folder. Does this work for you at your end?

Re: Error: Resource interpreted as Image but...

Posted: Mon Mar 31, 2014 4:35 pm
by 9337315
No, as I said, the filenames are incompatible with the browser. An example: "webChart1fe8054aa9b2fb393840%12635318269074611826png.png", which is how it appears on disk in windows explorer, but there may be escape characters in there and the % character is not allowed in browsers.
As I said -- "However, your PNG filenames here are being written out with double escape characters! of course giving a Bad Request 400 error. I have verified this by trying to read them with chrome. After editing the filename they can be handled OK. I am trying to figure out a way round this."

I can attempt to fix this myself, but it is quite difficult to do that without messing up all of my several projects' references. So what do I do?

Re: Error: Resource interpreted as Image but...

Posted: Mon Mar 31, 2014 5:00 pm
by Christopher
WCantrall wrote:No, as I said, the filenames are incompatible with the browser.
I'm using Win8.1 x64, VS2013, IIS8.5 and Steema TeeChart for .NET Source Code 2014 4.1.2014.02240, which I believe you have. Setting TempChart="File" in bubblechart.aspx in the ASP.NET demo shipped with the binary version works fine both in Chrome and in Internet Explorer.

The file names in _chart_temp are e.g.
WebChart11635318823130026364png.png
WebChart11635318822315665602png.png
WebChart11635318821777403292png.png
WCantrall wrote:I can attempt to fix this myself, but it is quite difficult to do that without messing up all of my several projects' references. So what do I do?
Clearly then there is a discrepancy between what you are experiencing and what I am experiencing, a discrepancy which at the moment I am unable to explain. Are you using the same software I am using?

Re: Error: Resource interpreted as Image but...

Posted: Mon Mar 31, 2014 5:33 pm
by 9337315
yes , it is the same. Here is the code you guys use:
//string fileRoot = ClientID.ToString() + Context.Request.UserHostAddress.ToString().Replace(".", "").Replace(":", "").Replace("%", "")
// + timeStamp.Replace(",", "").Replace("/", "").Replace(":", "").Replace(" ", "").Replace(".", "").Replace("%", "")
// + format.FileExtension;

So there is something on my machine or test websites that causes ClientID.ToString() or Context.Request.UserHostAddress.ToString().or timestamp to be different or to be encoded differently

Re: Error: Resource interpreted as Image but...

Posted: Mon Mar 31, 2014 9:55 pm
by 9337315
In examining the headers, the filename that is being used on my machine is the URL encoded string, where it should be using the non encoded string. When going to session, the same header (from GetChart) states it is text/html, not image/png. This may be due to the difference in length between the url encoded name and the non-encoded name, as you are getting the Mime type from the last 3 charatcters based on length of the string.

Re: Error: Resource interpreted as Image but...

Posted: Tue Apr 01, 2014 4:37 am
by 9337315
An update on all of this. "Hidden" away in Chrome was this further error message while trying again with Session.
"The file '/.../GetChart.aspx' has not been pre-compiled, and cannot be requested. "

Re: Error: Resource interpreted as Image but...

Posted: Tue Apr 01, 2014 8:12 am
by Christopher
WCantrall wrote:So there is something on my machine or test websites that causes ClientID.ToString() or Context.Request.UserHostAddress.ToString().or timestamp to be different or to be encoded differently
Yes. There is some similarity between the strings:

WebChart11635318823130026364png.png
webChart1fe8054aa9b2fb393840%12635318269074611826png.png

11635318823130026364
12635318269074611826

So the difference between them seems to be from "webchart" up to and including "%", which would appear to come from the value of ClientID.ToString(). Could you please tell us what the value of ClientID.ToString() is on your machine?

Re: Error: Resource interpreted as Image but...

Posted: Tue Apr 01, 2014 1:38 pm
by 9337315
I have added several comments previous to this which explain that the string is being url encoded apparently by ASP.Net, so changing that particular code will not help. They also detail the current error I am getting when trying to use Session. Apparently, the website(?) is complaining that getchart.aspx needs to be pre-compiled. Do you know how I would do that? Or could you actually send me a pre-compile getchart.aspx for Session?
(let me know if I am not using the site correctly--how to I put additional info in so you will see it?)

Re: Error: Resource interpreted as Image but...

Posted: Tue Apr 01, 2014 3:25 pm
by Christopher
WCantrall wrote:I have added several comments previous to this which explain that the string is being url encoded apparently by ASP.Net, so changing that particular code will not help. They also detail the current error I am getting when trying to use Session. Apparently, the website(?) is complaining that getchart.aspx needs to be pre-compiled. Do you know how I would do that? Or could you actually send me a pre-compile getchart.aspx for Session?
(let me know if I am not using the site correctly--how to I put additional info in so you will see it?)
I've been in consultation with some other members of our development team, and we were wondering if are you running the project from TeeChart sourcecode? If you are, we feel the information at debug time, before the entire URL string is created, with the content of ClientID.ToString() is critical to our understanding of how to proceed. If you are unable to get that information we will need to think of another way to do so.
WCantrall wrote:The file '/.../GetChart.aspx' has not been pre-compiled, and cannot be requested.
We are unfamiliar with this type of error message but believe it might be related to a setup problem in IIS. See this link for details, noting particularly comments about possible missing assemblies and/or
The AppPool that my site was running under had it's "Enable 32-bit applications" setting set to false. By changing this to true via the "Advanced Settings" dialog of the app pool i resolved my issue.
Are you able to create a simple WebForm application with TeeChart and get it running? If so you could add the GetChart.aspx file as a test. It makes no reference to TeeChart, infact uses TeeChart in no way; it is simply a file that generates a server call in response to a request.

It may be advisable to tackle this issue before looking at ClientID because there may be some basic setup issue with IIS or simply the IIS share being used for your tests with TeeChart.

Re: Error: Resource interpreted as Image but...

Posted: Tue Apr 01, 2014 3:44 pm
by 9337315
No, I am not. Your demo site will not run. I am creating a simple webform to test--everything where I do not use a webform works, File output does not work because of asp.net doing a url encoding of the file path, I am trying to get Session to work at this moment (website complains about getchart.aspx,, and cache and the http give MIME errors.

Re: Error: Resource interpreted as Image but...

Posted: Tue Apr 01, 2014 4:30 pm
by Christopher
WCantrall wrote:No, I am not. Your demo site will not run. I am creating a simple webform to test--everything where I do not use a webform works, File output does not work because of asp.net doing a url encoding of the file path, I am trying to get Session to work at this moment (website complains about getchart.aspx,, and cache and the http give MIME errors.
Again after consultation with other members of the team, we feel it may be best to leave the TeeChart demo project because of its inherent complexity and prove some basic functionality. Please could you create a webform project on your server without using TeeChart. Assuming that compiles and runs ok you can use the solution explorer to add GetChart.aspx and GetChartaspx.cs to the project. That should compile and run too. When that runs it would be a good moment to drag TeeChart's WebChart from the toolbox onto the Webform and compile/run. That should give you a webpage with an empty image where the chart is. The next step would be to select the Chart on the webform at designtime and from the properties window set the tempChart property to 'Session'. Session uses GetChart so is a good basic test for the next step. Check that the GetChartFile property includes the GetChart.aspx file name with to your project from root. eg. "/Yourpath/GetChart.aspx". Run the project. It should run showing a chart. If any of the steps we've described here fail at any stage please let us know as it will be a clue to any underlying problem.

Re: Error: Resource interpreted as Image but...

Posted: Tue Apr 01, 2014 10:45 pm
by 9337315
Christopher,
Thank you for the help. I have finally succeeded in getting the File method to work. I tried File again, after still encountering MIME errors (resource interpreted as image) with the other methods. For some unknown reason, the mangling of the file name has ceased. I will let you know in the next day or two if I can get session or any of the other types to work.
Bill