[Plugin] FileSaver

Post your completed addons to share with the community

Post » Mon Mar 05, 2012 8:20 pm

Update : v1.1 22/10/2012 : possibility to save images.

You can now save Image on disk ! You provide a base64 string of the image, and you can save it ondisk.

As an example, I'm taking a snapshot from the webcam, and saving the image :


The demo : https://dl.dropbox.com/u/1412774/SaveImageDemo/index.html.
The plugin : https://dl.dropbox.com/u/1412774/SaveImageDemo/pode_filesaver.1.1.zip
The .capx : https://dl.dropbox.com/u/1412774/SaveImageDemo/SaveImageDemo.capx
___________________________________________________

Something long waited for : the possibility to save files on local filesystem !



I used the FileSaver.js shim to make the plugin works crossplatform (https://github.com/eligrey/FileSaver.js). It should works with relatively new browser, but not necessarily cutting edge.
For the browsers that don't implement yet the FileSystem HTML5 API, the plugin at least open a new window with the right url set (base64, xml, and so on) to let you do a "right-click | Save as"...

For the moment, you can save text file and HTML strings as html files.

The demo : http://dl.dropbox.com/u/1412774/FileSaveDemo/FileSaverDemo.capx.

The plugin : http://dl.dropbox.com/u/1412774/FileSaveDemo/pode_filesaver.0.1.zip

Planned for next version : save images and save binary blobs...

Edit : cleaned a bit my botched english...Pode2012-10-22 18:14:27
B
33
S
9
G
5
Posts: 709
Reputation: 6,204

Post » Mon Mar 05, 2012 8:23 pm

Pode: providing solutions since 1832
^^

Good job, keep it up.Kyatric2012-03-05 20:24:10
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
196
S
68
G
32
Posts: 6,006
Reputation: 47,473

Post » Mon Mar 05, 2012 8:54 pm

would this work on ios?
B
27
S
12
G
7
Posts: 740
Reputation: 7,540

Post » Mon Mar 05, 2012 9:15 pm

@smitchell : no, because the WebKit build of Safari on iOS disable lots of things. But if you use PhoneGap, you can bypass that problem...
B
33
S
9
G
5
Posts: 709
Reputation: 6,204

Post » Mon Mar 05, 2012 9:15 pm

Gotch, it sounds amazing!
B
38
S
12
G
13
Posts: 623
Reputation: 10,251

Post » Tue Mar 06, 2012 12:15 am

@Pode

Great! I'll test it with my SpriteBank plugin.
B
73
S
18
G
17
Posts: 2,744
Reputation: 19,388

Post » Tue Mar 06, 2012 12:48 am

@Pode

It's a "world" plugin (appears in layout and is drawn), should it be a "object" plugin?rexrainbow2012-03-06 00:51:14
B
73
S
18
G
17
Posts: 2,744
Reputation: 19,388

Post » Tue Mar 06, 2012 8:59 am

@rexrainbow : ah yes ! It's because the template is copy/paste from another one I made. I'm going to change that in next release. Thanks !

Edit : I'm asking myself a question, because I'm not in front of C2. If you use an "object" plugin, are you allowed to have several of them, distinct from each other ? In fact, if you want to save several files, you need to have a "FileSaver" plugin for each file, to be sure that their content isn't mixed.Pode2012-03-06 09:01:13
B
33
S
9
G
5
Posts: 709
Reputation: 6,204

Post » Tue Mar 06, 2012 9:10 am

In my point of view, file saver plugin could have only one "action: save text to file" for saving text to file, which has two input parameters, one is source text, the other is saved file path.
It can be "pf_singleglobal" since there is no local data.

The plugin without "pf_singleglobal" is also great, it can save variables into object(plugin).
B
73
S
18
G
17
Posts: 2,744
Reputation: 19,388

Post » Wed Mar 07, 2012 11:52 am

Looks promising! Especially for the upcoming EXE wrapper. Everybody will want to write savegames with a small picture, characters, read from INI file, etc.
B
20
S
5
G
5
Posts: 115
Reputation: 5,289

Next

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest