|
From: Dejan K. <dej...@ya...> - 2003-09-11 16:44:07
|
I think you should put setFileType line AFTER if
statement, that is:
if (ftpClient.login(ftpUsername, ftpPassword))
{
if
(!ftpClient.changeWorkingDirectory(ftpFolder)) {
ftpClient.disconnect();
throw new
ScannerException(I18n.get("scanner.FtpScanner.error.notReachable"));
}
} else {
ftpClient.disconnect();
throw new
ScannerException(I18n.get("scanner.FtpScanner.error.login"));
}
ftpClient.setFileType(FTPClient.BINARY_FILE_TYPE);
I am curently at home and have no Linux FTP servers
around to try this code. I will try it tomorrow, bu I
think it shouold work. Your code seems wrong to me
since you try to set file type in else statament,
which you can reach if you haven't logged in
correctly.
Anyway, this should be just workround, since we should
have this as configurable option. Could you put this
as a feature suggestion at Babeldoc SourceForge page.
I will try to implement it ASAP.
Dejan
P.S. Please use mailing list for this type of
questions since it could be useful for others too.
--- "Mthombeni, Godfrey" <GMt...@fn...> wrote:
> Hi guys,
>
> First of all Babeldoc Rocks.
>
> I have a question regarding the FTP scanner. I'm
> using the FTP scanner to
> scan a client's ftp server to retrieve pdf
> documents. The client's ftp
> server is running on a linux box and my application
> is running on a NT box.
> The problem is by the time the scanner sends the
> document to the pipeline
> the document is already corrupt and cannot be
> processed. If I manually
> connect to the FTP server and get the document I
> have to send a "binary"
> command befor retrieving it. What I need to know is
> how can I send a
> "binary" command and wher in the FTPScanner code can
> I do that. Below is the
> code I used to try to solve the problem but it
> didn't work.
>
> private void connectToHost() throws
> ScannerException {
> ..........
>
>
> if (ftpClient.login(ftpUsername, ftpPassword)) {
> if (!ftpClient.changeWorkingDirectory(ftpFolder))
> {
> ftpClient.disconnect();
> throw new ScannerException(
>
> I18n.get("scanner.FtpScanner.error.notReachable"));
> } else {
>
> ftpClient.setFileType(FTPClient.BINARY_FILE_TYPE);
> }
>
>
> ........
> }
> your help will be highly appreciated.
>
> Regards
> Godfrey
>
>
>
___________________________________________________________________________________________________
>
>
> The views expressed in this email are, unless
> otherwise stated, those of the author and not those
> of the FirstRand Banking Group or its management.
> The information in this e-mail is confidential
> and is intended solely for the addressee. Access to
> this e-mail by anyone else is unauthorised.
> If you are not the intended recipient, any
> disclosure, copying, distribution or any action
> taken or
> omitted in reliance on this, is prohibited and may
> be unlawful.
> Whilst all reasonable steps are taken to ensure the
> accuracy and integrity of information and data
> transmitted electronically and to preserve the
> confidentiality thereof, no liability or
> responsibility whatsoever is accepted if information
> or data is, for whatever reason, corrupted
> or does not reach its intended destination.
>
>
> ________________________________
>
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
|