4

I want the content of a local text file to become available inside JavaScript. I've achieved that using HTML 5 FileReader API, but this works only in Mozilla Firefox and Chrome now.

I know that it is possible to create a cross-broswer solution using Flash. Is there any open-source project that do that?

Peter Mortensen
  • 30,030
  • 21
  • 100
  • 124
Alexey Zakharov
  • 24,074
  • 41
  • 124
  • 194

2 Answers2

2

Here's an open source project which provides you with the FileReader API in older browsers via flash:

https://github.com/Jahdrien/FileReader

Tom Teman
  • 1,864
  • 3
  • 28
  • 43
1

Yes, it's possible. Use the FileReference.load method

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference.html#load%28%29

I don't know how it compares with the HTML5 API though. There are 2 requirements for the Flash version. It requires Flash Player 10 and you can't select a file automatically without opening a dialog box telling the user to select a file. Also, this dialog box can only pop up after a user interaction (click on a button, ...)

Example here :

http://actionsnippet.com/?p=1702

Florian F
  • 8,567
  • 4
  • 36
  • 50