Hmm, there seem to be a problem when I attempt to verify the suggested
solution:

I have a local file on my computer
/Users/mattias/local_directory/ftp-test.txt
The URI I use is of type ftp://u...@host:21/remote_directory?password=secret
The Exchange.FILE_NAME in the header is set to ftp-test.txt

I have verified that the file exists locally (file.exists() == true), that
the ftp server is working and that the provided user has write access on the
FTP server (by logging in with a standalone FTP client using the same
credentials and sending a file) and that the remote_directory exists on the
FTP server.

This is the information that I receive:

INFO  [17:17:01 - main] RemoteFileProducer: Connected and logged in to:
Endpoint[ftp://u...@host:21/remote_directory?password=secret]
WARN  [17:17:01 - main] RemoteFileProducer: Writing file failed with: Error
writing file [remote_directory/ftp-test.txt]
ERROR [17:17:01 - main] FtpDeliveryImpl: Failed to FTP file
"/Users/mattias/local_directory/ftp-test.txt" to recipient
"ftp://u...@host:21/remote_directory?password=secret";
org.apache.camel.component.file.GenericFileOperationFailedException: Error
writing file [remote_directory/ftp-test.txt]


>From this I conclude that the FTP connection is successfully established,
but the file transfer fails.

When debugging I find that the FTPClient.storeFile() returns false because
the FTP response code is 500 (Syntax error, command unrecognized. This may
include errors such as command line too long.), but I fail to see that I
have done anything wrong?


The development machine runs Mac OS 10.6 and the remote FTP server runs on
some Linux distrubution. 
Camel version 2.3


Any suggestion is appreciated.

/Mattias




Claus Ibsen-2 wrote:
> 
> And the file will thus be kept as it was.
> 
> ProducerTemplate template = ...
> File target = new File("the file name here");
> 
> template.sendBodyAndHeader(ftpEndpointHere, target,
> Exchange.FILE_NAME, "the file name to be written on the ftp server");
> 

-- 
View this message in context: 
http://old.nabble.com/Dynamic-origin-file-components--tp28705368p28732839.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to