Where should temp files created by the MS Chart control go?

Brian Vander Plaats picture Brian Vander Plaats · Sep 10, 2010 · Viewed 8.9k times · Source

The default location:

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

is fine for development, but not so good for deploying on IIS. I found a forum post that mentioned you could drop the path altogether, which dumps the temp file(s) directly in the root of my project

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

I don't want to clutter up my root folder though, so I am settling on this for now:

<add key="ChartImageHandler" value="storage=file;timeout=20;url=~/App_Data/ChartImageTemp/;" />

Thoughts or what are other people doing? I'm a little curious as to why this is even a configurable option. I am using .net 3.5, maybe this is different in 4.0?

Answer

Brian Vander Plaats picture Brian Vander Plaats · Nov 24, 2010

A related question:

MSChart: ChartImageHandler pros/cons of the different storage settings

Pointed me to an article by Scott Mitchell:

http://www.4guysfromrolla.com/articles/081909-1.aspx

I've decided to use the "memory" option, so no files or paths to configure:

   <appSettings> 
      <add key="ChartImageHandler" value="storage=memory;deleteAfterServicing=true;"/> 
   </appSettings>