File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes download file from server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "download file from server" Watch "download file from server" New topic

download file from server

R. Roy

Joined: Apr 16, 2006
Posts: 7
I want to download the content of a specified directory(user-specific) present in the server to the client machine.
Here I dnt knw the content of the directory.I only knw the directory name(which differs from user to user).
Can nyone help me out with coded example?
Carl Trusiak

Joined: Jun 13, 2000
Posts: 3340
It all depends on the protocol you are using on the server, is it Samba, FTP HTTP, WebDAV?

Possibly the best way to do this is to use the VFS package from Jakarta Commons, changing the protocol you use for this is as simple as changing the URI you use for the directory path.

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
R. Roy

Joined: Apr 16, 2006
Posts: 7
I m using HTTP protocol bt cant it be done java programming with thee FILE class object?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63862

Not an advanced Java question.

Since you are using HTTP, I've moved this to the Servlets forum.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: download file from server
It's not a secret anymore!