I have a question regarding Apache's FTPClient.retrieveFile(), here's the situation, I've created a simple web application and I was planning on letting the users download files from a FTP Server whenever the user clicks a button or link on my web page. I found a library from Apache that contains FTP manipulations, and I want to use it as the method of downloading files from the FTP Server into the local drive of the user.
How will I achieve this?
I've tried to using retrieveFile() but it only downloads the files from the FTP Server into the Application Server not to the local drive (Client Side) of the user..
Not unless there's an applet or JavaWebStart application on the client that can run this code. But for a simple file download via FTP this isn't necessary, since browsers have FTP built in. If memory serves, the URL syntax would be something like "ftp://user:firstname.lastname@example.org/directory/TextFile" (check the appropriate RFC for how exactly an FTP URL looks).
If the file has a filename extension (like .txt, .pdf etc.), then the browser mechanism for dealing with downloads should kick in. In other words, it would be up to the user to configure their browser to display or save the file. Not sure how browser handle files that have no extension.