Andy E tiene razón en que no existe una forma basada en HTML de hacer esto *; pero si está dispuesto a utilizar Flash, puede hacerlo. Lo siguiente funciona de manera confiable en sistemas que tienen Flash instalado. Si su aplicación necesita funcionar en iPhone, entonces, por supuesto, necesitará una solución alternativa basada en HTML.
* ( Actualización 22/4/2013: HTML ahora admite esto, en HTML5. Consulte las otras respuestas).
La carga de Flash también tiene otras ventajas: Flash le brinda la capacidad de mostrar una barra de progreso a medida que avanza la carga de un archivo grande. (Estoy bastante seguro de que así es como lo hace Gmail, al usar Flash entre bastidores, aunque puedo estar equivocado al respecto).
Aquí hay una aplicación de muestra de Flex 4 que permite al usuario elegir un archivo y luego mostrarlo:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
creationComplete="init()">
<fx:Declarations>
</fx:Declarations>
<s:Button x="10" y="10" label="Choose file..." click="showFilePicker()" />
<mx:Image id="myImage" x="9" y="44"/>
<fx:Script>
<![CDATA[
private var fr:FileReference = new FileReference();
// Called when the app starts.
private function init():void
{
// Set up event handlers.
fr.addEventListener(Event.SELECT, onSelect);
fr.addEventListener(Event.COMPLETE, onComplete);
}
// Called when the user clicks "Choose file..."
private function showFilePicker():void
{
fr.browse();
}
// Called when fr.browse() dispatches Event.SELECT to indicate
// that the user has picked a file.
private function onSelect(e:Event):void
{
fr.load(); // start reading the file
}
// Called when fr.load() dispatches Event.COMPLETE to indicate
// that the file has finished loading.
private function onComplete(e:Event):void
{
myImage.data = fr.data; // load the file's data into the Image
}
]]>
</fx:Script>
</s:Application>