I'm working on an enterprise portal. One of the things i was asked to do is access a remote directory (like "\\machine\share\") and be able to, at least, list the files, download to the portal user any of them, and be able to upload some as well. Also my goal is to create dinamycally a directory inside the shared one for every record I insert into a database for, for example, creating a course (each course has an attachment of files with the schedules, curriculum, etc. in pdf or doc files).
Can anyone point me in the right direction on how to star this? are there any API's, packages or something like that that i can use?
I have allready done that type of Project
I use FTP to Connect remote server. there is api call com.enterprisedt.net.ftp you can download it free
also you can get the document of that API.
public remote()
{
try
{
localPath="localpath to download";
remotePath="remote path from server";
ftpClient = new FTPClient();
FTPMessageCollector listener = new FTPMessageCollector();
ftpClient.setMessageListener(listener);
ftpClient.setRemoteHost(ip of the remote host);
ftpClient.setTimeout(10 60 * 1000);
System.out.println("connecting to the Remote Server....");
ftpClient.connect();
System.out.println("connected to the Remote Server ");
ftpClient.login(username,password);
ftpClient.setConnectMode(FTPConnectMode.PASV);
ftpClient.setType(FTPTransferType.ASCII);
Re: Read and Write from Remote Shared directory
Aug 9, 2006 8:34 AM
(reply 3
of 3) (In reply to
#2 )
Thank you very much for your help. I tried to access the shared directory locally and had no problem at all.
But a problem persists. When i deply my code to the portal server, it doen't access the directory because it doen't have the same access rights i have. So, my question is: is there a way to, at the same time i access the shared folder with the File class to send also the user-pass required for it to have access ?