Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid temp images directory in chart handler configuration

I am using highchart and I am getting this error only when I run my website on IIS server in intranet network. Instead it works fine in the development server (visual studio 2012)

Invalid temp images directory in chart handler configuration [c:\TempImageFiles]. Please edit the web.config file. The CharImageHandler key, Dir value must point to a valid directory. The directory is required for temporary image storage when storage mode equals file system.

Stack trace

[DirectoryNotFoundException: Invalid temp images directory in chart handler configuration [c:\TempImageFiles\]. Please edit the web.config file. The CharImageHandler key, Dir value must point to a valid directory. The directory is required for temporary image storage when storage mode equals file system.]
   System.Web.UI.DataVisualization.Charting.ChartHttpHandlerSettings.Inspect() +1426397
   System.Web.UI.DataVisualization.Charting.ChartHttpHandlerSettings.ParseParams(String parameters) +1352
   System.Web.UI.DataVisualization.Charting.ChartHttpHandler.get_Settings() +197
   System.Web.UI.DataVisualization.Charting.ChartHttpHandler.InitializeControllerFile() +51
   System.Web.UI.DataVisualization.Charting.ChartHttpHandler.EnsureInitialized(Boolean hardCheck) +357
   System.Web.UI.DataVisualization.Charting.Chart.get_CurrentImageLocation() +50
   System.Web.UI.DataVisualization.Charting.Chart.Render(HtmlTextWriter writer) +345
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +249
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +249
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +395
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +49
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +249
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +249
   System.Web.UI.Page.Render(HtmlTextWriter writer) +40
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5363
like image 623
SPandya Avatar asked Dec 05 '13 10:12

SPandya


2 Answers

Previously it was like this in web.config

<add key="ChartImageHandler" value="storage=file;timeout=20; dir=c:\TempImageFiles/;" />

I removed the directory location

<add key="ChartImageHandler" value="storage=file;timeout=20;" />

And the problem solved.

like image 93
SPandya Avatar answered Oct 16 '22 15:10

SPandya


Check if that folder exists on your server and give read/write permission to the user of the application pool your site is running for that folder.

Or you can simple move that temp folder inside the site root Es: "~/temp" and configure highchart to use that folder.

Or you can change your ChartImageHandler from

<add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;" />

To

<add key="ChartImageHandler" value="storage=file;timeout=20;" />

So he will use the default windows temp directory

like image 6
giammin Avatar answered Oct 16 '22 17:10

giammin