Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File Download/Create - To a user specified directory and name

 
Priyaa Vijay
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I know how to show a popup dialog box for uploading a file. I write

<input type="file" name="datafile" size="40">

it shows a TextField and a Browse button on clicking which I get a "Choose File" window and I navigate to the desired directory and a file.

What I am looking for is the reverse. I want something like a File Save as dialog, ie the user clicks a button and we allow him to choose the directory and then in that dialog he types the filename and clicks ok. Then we go and create that file and write some contents to it.

How to achieve this in html?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is nothing to achieve that in HTML.

Eric
 
Priyaa Vijay
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply. I shall try to find out what is the alternate solution.
 
Priyaa Vijay
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to achieve this using javascript or anything else on a Web Page? Appreciate any inputs.

thanks
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript can not access the clients computer for major security reasons, you may be able to find an activeX or applet that can do it, but I have no other solution than those ideas.

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic