commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Cooper" <>
Subject Re: [net] Multiple File Upload Problem
Date Fri, 14 May 2004 19:38:19 GMT
You might have more luck with getting the right people to help you if you
indicate which Commons component you are using in the subject line, per this
list's convention. When I read the subject, I thought you were referring to
Commons FileUpload, but it looks like you're referring to Commons Net

Martin Cooper

"Mohammed Abbas" <> wrote in message
> Hi All,
> Im truly bugged for time and I would really need some help.
> Part of my project requires me to use an FTP Client that can send
sceheduled tasks to a FTP Server residing on my network. All went well when
I tried using this operation on one file but now I having problems
implemeting the same logic with multiple files (binary). Im using a Timer to
schedule the events to a Timer Task that lists all the files in the
directory and passes them FTP Client reference in the TimerTask.
> When Im getting is that when the task is handling one file it returns a
FileTransfer OK (250) then a disconnection from the FTP Server and the
program exits. Refering back to some logs using a different FTP Software the
PORT Command is called after successive calls to the FTPServer and does so
for until there are no files (I already tried simulating the scenario using
the SocketClient APIs but Im still getting the same result.)
> Im initialising the FTPClient (connecting,validating connection then
logging in + setting binary filetype --- already active mode). Then I'm
passing storing the file using the store(String, FileInputStream) method. Im
iterating the stor operation through a loop with no checks)
> 1) Is this is the way that its supposed to be done? If not how then.
> 2) Would it matter if I used the default Active mode instead of the Pasv
mode. Which one is better programmatically.
> 3) I cant find any samples for the multiple stor operation. Can someone
please attach a some code samples for the multiple send.
> Thanks,
> <CODE>
> for (int i = 0; i < files.length; i++) {
>   synchronized (mScheduler) {
>      try {
>     String remoteFilePath = transfer.getRemoteDir() + "/" +
>   //mScheduler.mFtpClient.port(, 51);
> stream = new[i].getPath());
>   mScheduler.mFtpClient.storeFile(files[i].getName(), stream);
>   stream.close();
> }
> catch (IOException ioe) {
>   ioe.printStackTrace();
> }
> catch (Exception e) {
>   e.printStackTrace();
> }
>   }
> }
> </CODE>
> _____________________________________________________________________
> Participate in 'Send and Win' SMS contest and win exciting prizes.
> Visit for more details.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message