Re: Client side file I/O

2010-05-11 Thread ben fenster
you can use php to create a server side script that will create a file
from data you will send via post request and  alink to the file
this way u will create save  button that will be a download link to a
file in the server side
loading shold be even easier since it just a file upload

On 10 מאי, 21:45, David Given d...@cowlark.com wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 I have a rich app client that wants to be able to construct data
 algorithmically and save the result; it also wants to be able to read a
 local file, and process it locally.

 [No, I do *not* want unrestricted access to the filesystem from the
 client! I want to do all this via standard file load/save dialogues
 mediated by the user, like a sane app does.]

 I can save data by constructing a data: URL, invoking it, and the web
 browser will pop up a save dialogue to the user; this is ideal.

 Unfortunately the only way I've found in classic HTML of loading data is
 to use a file upload field, but that doesn't let the client see the data
 - --- it sends it straight to the server. Apart from being a waste of time
 and bandwidth, my app may not *have* a server (instead running entirely
 locally).

 Are there any new techniques I'm not aware of that will allow me to
 prompt the user for a file and then be able to get the contents of the
 file into a client-side structure so I can process it?

 I'm willing to use Gears or HTML5 if necessary, but I'd prefer to use
 stock HTML/JS if possible.

 - --
 ┌─── dg@cowlark.com ─http://www.cowlark.com─
 │
 │ There is no Fermi Paradox. Any time space faring aliens make it to
 │ Earth, the cows get them. --- Sam Starfall
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (GNU/Linux)
 Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/

 iD8DBQFL6HBNf9E0noFvlzgRAthtAJ9z9Ctqgch4o+GoEals2Is5UCkBpgCcCzXJ
 DzHZtGbGNaLs777RQLe22dc=
 =UHjb
 -END PGP SIGNATURE-

 --
 You received this message because you are subscribed to the Google Groups 
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://groups.google.com/group/google-web-toolkit?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Client side file I/O

2010-05-10 Thread David Given
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I have a rich app client that wants to be able to construct data
algorithmically and save the result; it also wants to be able to read a
local file, and process it locally.

[No, I do *not* want unrestricted access to the filesystem from the
client! I want to do all this via standard file load/save dialogues
mediated by the user, like a sane app does.]

I can save data by constructing a data: URL, invoking it, and the web
browser will pop up a save dialogue to the user; this is ideal.

Unfortunately the only way I've found in classic HTML of loading data is
to use a file upload field, but that doesn't let the client see the data
- --- it sends it straight to the server. Apart from being a waste of time
and bandwidth, my app may not *have* a server (instead running entirely
locally).

Are there any new techniques I'm not aware of that will allow me to
prompt the user for a file and then be able to get the contents of the
file into a client-side structure so I can process it?

I'm willing to use Gears or HTML5 if necessary, but I'd prefer to use
stock HTML/JS if possible.

- -- 
┌─── dg@cowlark.com ─ http://www.cowlark.com ─
│
│ There is no Fermi Paradox. Any time space faring aliens make it to
│ Earth, the cows get them. --- Sam Starfall
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFL6HBNf9E0noFvlzgRAthtAJ9z9Ctqgch4o+GoEals2Is5UCkBpgCcCzXJ
DzHZtGbGNaLs777RQLe22dc=
=UHjb
-END PGP SIGNATURE-

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Client side file I/O

2010-05-10 Thread Sripathi Krishnan

 Are there any new techniques I'm not aware of that will allow me to prompt
 the user for a file and then be able to get the contents of the file into a
 client-side structure so I can process it?

If your clients have Flash Player 10, you can use Flex to read or write
files, *provided* the action is initiated by a user click. See
http://www.mikechambers.com/blog/2008/08/20/reading-and-writing-local-files-in-flash-player-10/

Javascript and flash can communicate, so theoretically, you can write GWT +
JSNI code, compile a simple flex app that takes the data as parameters,
intercepts the user click and pops up the file dialog. You'd have to mess
around with GWT, JS and flex though to get it working properly.

In practice, its much easier to make a server round trip. You can deploy to
Google App Engine - its free for trivial uses.

--Sri


On 11 May 2010 02:15, David Given d...@cowlark.com wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 I have a rich app client that wants to be able to construct data
 algorithmically and save the result; it also wants to be able to read a
 local file, and process it locally.

 [No, I do *not* want unrestricted access to the filesystem from the
 client! I want to do all this via standard file load/save dialogues
 mediated by the user, like a sane app does.]

 I can save data by constructing a data: URL, invoking it, and the web
 browser will pop up a save dialogue to the user; this is ideal.

 Unfortunately the only way I've found in classic HTML of loading data is
 to use a file upload field, but that doesn't let the client see the data
 - --- it sends it straight to the server. Apart from being a waste of time
 and bandwidth, my app may not *have* a server (instead running entirely
 locally).

 Are there any new techniques I'm not aware of that will allow me to
 prompt the user for a file and then be able to get the contents of the
 file into a client-side structure so I can process it?

 I'm willing to use Gears or HTML5 if necessary, but I'd prefer to use
 stock HTML/JS if possible.

 - --
 ┌─── dg@cowlark.com ─ http://www.cowlark.com ─
 │
 │ There is no Fermi Paradox. Any time space faring aliens make it to
 │ Earth, the cows get them. --- Sam Starfall
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iD8DBQFL6HBNf9E0noFvlzgRAthtAJ9z9Ctqgch4o+GoEals2Is5UCkBpgCcCzXJ
 DzHZtGbGNaLs777RQLe22dc=
 =UHjb
 -END PGP SIGNATURE-

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.