title: Playing Quicktime video on iPhone using HttpHandler and IIS 5.1
body: <p>I'm trying to stream QuickTime video to an iPhone from an ASP.NET web application using an HttpHandler.  When hosting the web application from IIS 5.1 (Windows XP), the video player opens and then displays the error 'The server is not correctly configured'.  However, when using IIS 7.5 (Windows 7), the video plays fine.</p>
  
  <p>The production environment is running IIS 6.0 and has the same problem, where attempting to play videos on the iPhone via Mobile Safari displays the error above.</p>
  
  <p>I've checked the Http Headers and they appear to be practically the same between the two servers (apart from a few, such as the <em>Server</em> header, which will obviously be different), except they appear in different order, though I doubt that this is causing the problem.</p>
  
  <p>According to <a href="http://groups.google.com/group/iphonewebdev/browse_thread/thread/794c4b5cb6d59768/c4073c261ab43d18?#c4073c261ab43d18" rel="nofollow noreferrer">this thread</a> on Google Groups, adding the 'Accept-Ranges: bytes' header can help, though this made no difference for us.  I've also added the ETag header, without any luck.</p>
  
  <p>The code actually responsible for sending the file looks something like this:</p>
  
  <pre><code>Context.Response.Buffer = true;
  Context.Response.ContentType = "video/x-m4v";
  
  Context.Response.AppendHeader("Content-Disposition", "filename=\"Video.m4v\"");
  Context.Response.AppendHeader("Content-Length", "23456789");
  
  Context.Response.AppendHeader("Accept-Ranges", "bytes");
  Context.Response.AppendHeader("ETag", GetETag(path));
  
  Context.Response.TransmitFile(path);
  </code></pre>
  
  <p>The code above which transmits files appears to be functioning correctly and video files play back correctly in all desktop browsers and when hosting from IIS 7.5 on Windows 7.  The problem is only apparent when attempting to play video files on the iPhone using Mobile Safari using the above code with the ASP.NET web application being hosted on IIS 5.1 or IIS 6.0.</p>
  
  <p>Has anyone else experienced anything like this and got any ideas on what I can do to get this working?</p>