Domanda

Ho provato diversi metodi per aprire e mostrare un file sul client senza per inviare il file a un server.

Apertura: ho provato ad accedere al file con javascript da un <input type=file>, ma la restrizione sicurezza sembra non permetterlo. Ho provato anche <iframe src=file://local.path> con lo stesso problema. Ultimo ho provato con new ActiveXObject('Scripting.FileSystemObject');, ma ottengo sempre un errore che AutomationServer non ha potuto creare l'oggetto.

Per salvare ho cercato di usare execCommand('SaveAs',true) da TextRange e DocumentFragment. Da DocumentFragment sono in grado di salvare un file, ma contiene solo <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">. Da TextRange non è Salva finestra di dialogo mostrata.

Che cosa potevo fare?

È stato utile?

Soluzione

From a web site, you cannot do any of this unless you use a signed script

From local file system, IE can use the filesystem object from an HTA

Altri suggerimenti

Sorry,

You can not access the local file system through a browser without having the user install a plug-in/activex object.

It may be that you should try another cross-platform delivery method, such as Adobe Air.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top