[Plugin] FileReader

Post your completed addons to share with the community

Post » Tue Mar 13, 2012 2:29 pm

Update v1.1 19/10/2012 : bugfixe + load images !
Here's a new version of the FileReader plugin !

I fixed a bug, and added thee possibility to load an image file :


Useful, for example in Awesomium, where you can't do a drag'n'drop from desktop to add an image to your game (thanks @Joannesalfa for the use case ).

The demo : https://dl.dropbox.com/u/1412774/FileReaderDemo2/index.html
The capx :
https://dl.dropbox.com/u/1412774/FileReaderDemo2/FileReaderDemo2.capx
The plugin : https://dl.dropbox.com/u/1412774/FileReaderDemo2/pode_filereader.1.1r.zip

_____________________________________________

In conjonction with the FileSaver plugin, here's a FileReader plugin !
It should work on relatively new web browsers (there's no easy fallback for older browser, like the FileSaver plugin).


For the moment, only text file are loaded...

The demo : http://dl.dropbox.com/u/1412774/FileReaderDemo/index.html
The capx :
http://dl.dropbox.com/u/1412774/FileReaderDemo/FileReaderDemo.capx
The plugin : http://dl.dropbox.com/u/1412774/FileReaderDemo/pode_filereader.0.1.zip

(And yes, I know there's a typo in my test file )Pode2012-10-19 17:02:20
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Wed Mar 14, 2012 10:35 am

Another great plugin from you.
B
13
S
3
G
3
Posts: 53
Reputation: 3,306

Post » Wed Mar 14, 2012 9:07 pm

This is neat, but could you make it have a 'load file' action that can use a path so files can be loaded via events dynamically? That would make it much, much more useful. Loading a level by choosing it in a window isn't really realistic.Arima2012-03-14 21:09:19
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,422

Post » Wed Mar 14, 2012 10:18 pm

@Arima : it's not going to be possible in the current state of the support in the browsers, because it's breaking the sandbox model.
The most I can do is allowing the styling of the button, to blend it in your webapp GUI.
I'm going to search if there's a hack around it, but I'm pretty sure there isn't any, sorry.
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Wed Mar 14, 2012 11:00 pm

Ah well. Thanks for the reply.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,422

Post » Thu Mar 15, 2012 8:31 am

@ Arima: that's possible with ajax. I load json data at runtime - calling level1.php, level2.php.. ;)
Joe72012-03-15 12:22:27
B
14
S
6
G
5
Posts: 173
Reputation: 4,742

Post » Thu Mar 15, 2012 6:44 pm

@Joe7 I was talking about loading from a file on a local disk, which as far as I understand AJAX is incapable of?

BTW if you put a space between the @ and the person's name, it doesn't trigger an alert.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,422

Post » Fri Mar 16, 2012 7:09 am

In fact, AJAX and FileReader can access a file directly on Chrome, if you set the flag to allow it. You can't obviously ask that to your user (because it's a big security risk).
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Fri Oct 19, 2012 10:45 pm

I have updated the first post with a new build. You can now load image files too.
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Mon Oct 22, 2012 12:12 am

Nice plugin. Does it work with Awesomium though. I tried to export your test capx with the Awesomium exporter but when I press the Choose File button nothing happens. Tested this on r107 realease. ThanksFilhanteraren2012-10-22 00:58:33
B
10
S
1
G
2
Posts: 2
Reputation: 2,199

Next

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest