title: Solutions to allowing intranet/local file access in an HTML5 application?
body: <p>I am all too aware of the fact that even with the new FileAPI it's not possible to access the local path of a file added using a file input field or drag-and-drop. Whether or not this is good, bad or ugly is not the issue here. According to the FileAPI specs local file access is not to be implemented, and so I'm not holding my breath.</p>
  
  <p>But let's just <em>pretend</em> I'm in a situation with the following fixed parameters:</p>
  
  <ul>
  <li>Developing an HTML5 application only to be used internally at a company</li>
  <li>.NET used for backend (needed due to interop with APIs)</li>
  <li>Can specify/control exactly which browser and version should be used with the application</li>
  <li>Need to access files that are usually located on a network share, but possibly also locally at a user's workstation</li>
  </ul>
  
  <p>And by access I don't mean access file data, but rather be able to relay a file drag-and-drop/select event to some other API by feeding the third party the file's local path, so that the third party can pick up the file and do some sort of work on it. This can be likened to using an input[type=file] field as you would an OpenFileDialog in .NET - i.e. the point is to feed the application a file path, not an <em>actual file</em>.</p>
  
  <p>I realise that out of the box this is probably not possible. But I also think that there must be some sort of solution to the problem.</p>
  
  <p>Some ideas I've been toying with are:</p>
  
  <ul>
  <li>Using browser specific methods for allowing "secure features"
  <ul>
  <li>Not sure if possible - tired using some of these features to no avail</li>
  <li>Would limit the app to a specific version of a browser as the functionality could potentially be removed in the future</li>
  <li>Something like a Chrome extension could possibly do the trick</li>
  </ul></li>
  <li>Using some sort of companion application installed locally on a clients computer that takes care of all on-disk file handling, possibly communicating with the HTML5 client using websockets or the like.
  <ul>
  <li>A potentially pretty messy solution</li>
  <li>Would probably confuse the users a bit at first</li>
  </ul></li>
  <li>Submitting the selected file data to the server, storing it at specific path and sending this new path to the third party.
  <ul>
  <li>Would constitute a lot of sending files over the company network, some 100+ MB in size</li>
  <li>Would not be able to do any in-place changes to a file a user has selected</li>
  </ul></li>
  </ul>
  
  <p>... and that's about it.</p>
  
  <p>Any snazzy suggestions? Wise words? Helpful links? Snarky comments?</p>
  
  <p>Thanks.</p>
  
  <p><strong>Edit:</strong> For anyone curious about it, this was very simple using Silverlight as per jgauffin's suggestion below.</p>
  
  <p>From the Silverlight codebehind (using elevated privileges):</p>
  
  <pre><code>private void fileBtn_Click(object sender, RoutedEventArgs e)
  {
      //prompt file select dialog in Silverlight:
      var dlg = new OpenFileDialog();
      dlg.ShowDialog();
      //call JavaScript method and feed it the file path:
      HtmlPage.Window.Invoke("onFileSelected", dlg.File.FullName);
  }
  </code></pre>