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()));
//System.out.println(out);
any help in this regards is helpful.
Thanks,
Saurabh
sm195@lucent.com
973-386-6850