B2B FTP Listner - unable to do ftp put

I am using this peice of code to handle unrecognized content type. This works fine when I ftp any file with .txt extension, but if i use any other extension say .edi or .datetimestamp, the ftp put fails.

ftp> put ediorder.edi
200 PORT command successful.
553 ‘ediorder.edi’: cannot write.

ftp> put ediorder.txt
200 PORT command successful.
150 Binary mode data connection for ediorder.txt
226 Binary transfer complete.
local: ediorder.txt remote: ediorder.txt
542 bytes sent in 0.014 seconds (37.90 Kbytes/s)

//System.out.println(“contentstream NOT NULL… ==>> unrecognized content type…”);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
byte[] buf = new byte[1024];
int read = is.read(buf);
int counter = 0;
while (read >= 0) {
counter += read;
bos.write(buf, 0, read);
read = is.read(buf);
out.put(“textData”,new String(bos.toByteArray()));

any help in this regards is helpful.

A ContentHandler is selected using the mime type of the incoming data. In the case of FTP Listener the mime type is determined from the extension of the file, in your case “txt”. There is a mime.types file in the server/lib directory that contains the mappings of extension to mime type.

Add your new file extensions to the text mime type.