[Cc:ing jakarta-commons-dev for infor purposes]

type() is a lower-level method , in fact setFileType() calls type() internally, but setFileType() also does some book-keeping..i.e. it sets a couple of internal variables, that are used when storing or retrieving files. If these are not set, then you may not get the correct stream type.

Rory

Echevarria, Octavio wrote:
Thanks for your reply.  Ahhh... there is nothing like seeing sample
code.  I replaced a call to type() with setFileType() and it works now!!

So the question now is: what is the difference between the two?  I have
not looked at the source code but both take the same argument. One is
defined in FTP and the other in FTPClient.

BTW, the call to completePendingCommand() causes my program to hang.
This is right after I make the call to storeFile().

I have unit tested my change but I will wait until tonight for the
official build and I will let you know.

Regards,
Octavio
Octavio Echevarria
CA
Senior Software Engineer
AllFusion Gen Development
tel: +1 214 473 1281
fax: +1 214 473 1323
[EMAIL PROTECTED]
-----Original Message----- From: Rory Winston [mailto:[EMAIL PROTECTED] Sent: Sunday, June 03, 2007 10:46 AM
To: Echevarria, Octavio
Subject: Re: commons net question

Hi Octavio

Firstly, sorry for not replying sooner - I have been out of the country.

As to your issue, it may be related to you not calling completePendingCommand().

See the following FAQ entry "*Q:After I perform a file transfer to the server, printWorkingDirectory() returns null." *on the FAQ page

http://wiki.apache.org/jakarta-commons/Net/FrequentlyAskedQuestions

If this does not fix your issue, then feel free to send me your code and

I will take a look.

Best,
Rory
**
Echevarria, Octavio wrote:
Rory,

I am new to the commons net package. I have written a small java utility to transfer files using FTP from a workstation to a server.

When I transfer files in ASCII mode everything seems to work fine. However when I do the same for binary files, the files are corrupted on arrival.

Is there a special sequence of commands that must be issued for this to work?

FTPing the same file using the standard windows/dos ftp command works fine. I am also able to use FTP capabilities within a terminal emulator package and everything works fine. In both situations I target the same server. So I know that the FTP server is able to accept to the upload commands for both binary and asccii files.

I am trying to figure out if there is perhaps a bug in the commons net

package.  I can send the code if you need me to.

I apologize if this is not the proper medium for solving this, but any

help would be greatly appreciated.

Regards,

Octavio

Octavio Echevarria

CA

Senior Software Engineer

AllFusion Gen Development

tel: +1 214 473 1281

fax: +1 214 473 1323

[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>










---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to