• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to create a new file into client side  RSS feed

 
Maresq Mariane
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I will try to be clear with my english...

I want the user on the client side to be able to save the results shown in the JSP page to a new XLS file.

When he clicks on a button, a popup appears (like "file-save as" standard in web pages), User choose his folder and gives the name of the file to be created.
My servlet will generate the result file with the name input by the user into his folder using outputStream class.

What is the way to able the user to choose his folder ? I can't use "input type file" because the file must exist with this input type.

I hope my request to be clear...

Thank you for your help.
Mariane
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the button is clicked, submit to a servlet that streams the file to the browser with the appropriate content-type and content-disposition headers. The browser will take care of everything else.

Search this and the Servlets forum for terms like "content-disposition" for concrete examples.
 
Maresq Mariane
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your quick answer, but, what I really need is

what kind of "button" or "input type" can I use to make the same think that "File -save as" : Go to client directories, choose the good one etc...

It is not "input type="file" , because file must already exist.

Do you know the html method to do this ?

Regards,

Mariane
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not something that's done on the HTML side.

As bear mentioned, the "Content-Disposition" header coming from the server is what triggers that.
 
Maresq Mariane
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, thank you very much, I didn't understand the first time, but know, I just tryed to use "content-disposition" and it works fine.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!