rlaferia: You can not store data that the client knows, on disk. It is
-impossible-, a limitation of the HTML/JavaScript platform. There is a
little known method (involving the data:// URL protocol) that could do
it for data sets that aren't too large, but it doesn't work on IE6 or
7. Maybe it'll work on 8, that would really make all our lives so much
easier. If you want more info on this, wikipedia for the data://
protocol. It should be more than enough to figure it out.

The standard strategy is to make your client (your GWT code) upload
this data to the server (which is easy), and then generate a link to
the server which will fetch the information again, properly festooned
with the headers required to make a download popup appear. This seems
dumb (upload info just so you can download it? eesh!) but usually the
data in question came from the server anyway, in which case you should
just generate the download link immediately. Also, it's the only way,
as I mentioned.

And these headers of which I speak? Something like application/octet-
stream or some such magic abacadabra word. Google the web, or this
group, I'm sure you'll find the specifics.

On Nov 29, 5:36 am, rlaferla <[EMAIL PROTECTED]> wrote:
> Here's a tricky one for you GWT experts!
>
> In my application, I need to dynamically create a text file (in
> memory) and allow the user to download it.  In a traditional web
> application, this is easy.  However, how can you do this with GWT?
> Before you answer, keep in mind that the file does not exist on disk
> anywhere.  Therefore, a GWT-RPC service would send a String back to
> the GWT client and the client would have to do something to trigger
> the download of that string as a file.  I have already searched this
> forum and there is a thread on doing a file download but that's for a
> file that exists on disk and for various reasons, my application
> cannot write the string to a file first.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to