1. The server has to send the file with a data type of application/
octet-stream.
2. You can't use an AJAX call (RequestBuilder / HttpRequest / GWT-
RPC), those will never generate a save as box on the user's client.
Use:

1. A link that a user clicks on.
2. open a new window using Window.open
3. redirect the current page to your excel page. I'm not sure if
there's a GWT way, but with JSNI it's a matter of "window.location =
"http://whatever";';
4. Like #3, but do this in an iframe you just created, so that the
user doesn't lose the GWT page.

On Sep 11, 11:08 am, Folke <[EMAIL PROTECTED]> wrote:
> Plan A: Storing the file on the server.
>
> 1. Submit the data to the server
> 2. The server converts and stores the Excel data (temporarily) and
> assigns an ID
> 3. ID is sent back to the client
> 4. Open a new window or use an iframe with the download URL containing
> the ID as GET parameter
> 5. Server sends the Excel data with MIME type "application/octet-
> stream".
> 6. "Save as ..." dialog opens.
> 7. ???
> 8. Profit!
>
> Plan B: IFrame with form submit
> 1. Create an invisible IFrame containing a form with your data in a
> hidden field
> 2. Submit the form via Javascript.
> 3. (magick)
> 4. "Save as ..." dialog opens.
> 5. ???
> 6. Profit!
>
> On Sep 11, 10:34 am, Simon Rydberg <[EMAIL PROTECTED]> wrote:
>
> > I'm having the same problem.. I have a servlet that I make a POST ( I
> > can't do a GET request because I send a lot of data to the servlet )
> > request with the RequestBuilder to the servlet and it recives all the
> > data, creates, in my case an excel file and then the client recives
> > the responce in a RequestCallback. And then nothing happens, except
> > that the status of the responce is OK with code 200.. I want the user
> > to see the download file form when the responce comes.
>
> > I have searched this group and via google with an answer to my
> > problem. Found some answers when you are making a GET-request, but
> > nothing when you make a POST request...
--~--~---------~--~----~------------~-------~--~----~
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