wood burning stoves 2.0*
The moose likes Applets and the fly likes file saving Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "file saving" Watch "file saving" New topic
Author

file saving

Nijin puthiya purayil
Ranch Hand

Joined: Nov 09, 2011
Posts: 32
Hai,
I need to save a zip file to a specified folder using the FileDialog window...actually in my applet application i downloaded a number of files and zipped them all in a single zip file in my temp folder...but i want this zip file to be saved in any other folder instead of saving it to temp folder, by showing the save dialogue window...from which the user can choose a desired folder to save this file.... can i use FileDialog() for this??
please do help me...
Nitin Surana
Ranch Hand

Joined: Jan 21, 2011
Posts: 129

I personally would have preferred using a JFileChooser which can be configured to select files or directories.

And here is a good example of JFileChooser, if you need.

http://www.onlinexamples.com/showfullexample.action?idexamples=81&title=Display%20Image%20In%20Jlabel%20Within%20A%20Jpanel
Nijin puthiya purayil
Ranch Hand

Joined: Nov 09, 2011
Posts: 32
Thanks for your reply....
But here this is not actually working for me...
Nitin Surana
Ranch Hand

Joined: Jan 21, 2011
Posts: 129

Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

Unless signed, an Applet can't interact with the local filesystem.


luck, db
There are no new questions, but there may be new answers.
Nijin puthiya purayil
Ranch Hand

Joined: Nov 09, 2011
Posts: 32
Darryl Burke wrote:Unless signed, an Applet can't interact with the local filesystem.

I'm using signed applet ...but still not getting the result....can i save a file before writing contents into it?
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
You need to tell us what *is* happening, and what you were expecting to happen instead. Seeing the related code would also help.
Nijin puthiya purayil
Ranch Hand

Joined: Nov 09, 2011
Posts: 32
Here is my code to zip the files...
the name comes from a list...there is now two files in the name filed, and it can be more than two...here i want to save the zipFile to any folder using the JFileChooser instead of saving it to the temp folder..in my code i saved it in the temp folder..
Here the zipping action works fine and the file is saved with the name zipdemo.zip in the temp folder...

Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
I'm not following - if you don't want to save the file in the temp directory, why are you doing so? You've already been pointed to an example of using a JFileChooser to select a different directory; what stops you from doing that?
Nijin puthiya purayil
Ranch Hand

Joined: Nov 09, 2011
Posts: 32
Thanks Tim Moores....
I was trying it through the wrong path
thanks again
 
jQuery in Action, 2nd edition
 
subject: file saving
 
Similar Threads
Saving image on server.
FileDialog.SAVE (urgent please)??
point to a folder (directory in windows)
Zip a folder programatically ??
Copy a picture from temp folder to another