Java applet help
Author
Discussion

KITT

Original Poster:

5,345 posts

271 months

Tuesday 10th May 2005
quotequote all
I'm a total Java newbie and need to create an applet that can download a file, stored on the same webserver the applet is, to the client's machine.

I know about signing it etc. to allow file access on the client's machine, I'm just not sure how to get the Java to download the file to their machine.

Any suggestions folks?

groucho

12,134 posts

276 months

Tuesday 10th May 2005
quotequote all
Ask the question Here loads of java boffins there.





>> Edited by groucho on Tuesday 10th May 17:17

anonymous-user

84 months

Tuesday 10th May 2005
quotequote all
Drop me a mail with a few more details if you like and I'll see if I can sketch something out.

Basically, you'd want to do something along the lines of...

Open http connection to webserver.
Open filstream to fs.
Until file downloaded, read x bytes, write x bytes.
Done.

Could make it fancy by putting a file system browser to choose where to save it, use the content size header to run a progress bar, etc. etc.

A great place for code snippets is www.javaalmanac.com/

KITT

Original Poster:

5,345 posts

271 months

Tuesday 10th May 2005
quotequote all
Cheers for the links chaps

Darran - YHM

>> Edited by KITT on Tuesday 10th May 18:42

KITT

Original Poster:

5,345 posts

271 months

Friday 13th May 2005
quotequote all
Guys,

I've got it working now However, I need to get the path for the libraries and am using the following code:

LibDir = System.getProperty("java.library.path";

This works for Netscape and Firefox (i.e. using proper Java) but Internet Explorer's Java returns null Anyone know how to get that information? Or at least the temp dir?

cheers

KITT

Original Poster:

5,345 posts

271 months

Monday 16th May 2005
quotequote all
bump