Skip to content

Instantly share code, notes, and snippets.

@ff6347
Created October 4, 2012 18:32
Show Gist options
  • Save ff6347/3835492 to your computer and use it in GitHub Desktop.
Save ff6347/3835492 to your computer and use it in GitHub Desktop.
Load Text file and show in alert()
var txtfile = File.openDialog ("Choose a textfile for filling", "*.txt", false);
// It works like this.
// test if txtfile is not null
if(txtfile != null){
txtfile.open("r");
content = txtfile.read();
txtfile.close();
alert(content);
}else{
alert("You did not select a file");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment