Hi,
You need to do two extra things.
1. The server has to notify that it is ready to
receive data by sending response 150 before getting
the stream. Unless client receives 150, it will not
send any data.
2. If everything is fine, the server should send 226
response to client.
So the code block should look like:
public FtpletEnum onUploadStart(FtpRequest request,
FtpResponse response) throws FtpException, IOException
{
response.write(150, "STOR");
InputStream is = request.getDataInputStream();
while (is.read() > 0) { //command line hangs
System.out.println( "read Data");
}
response.write(226, "STOR");
return FtpletEnum.RET_SKIP;
}
Thanks,
Rana Bhattacharyya
--- Mike Greene <[EMAIL PROTECTED]> wrote:
> I created my ftplet and can't get it to work with
> windows command line ftp
> or ncftp. The Stream never reads data it just
> hangs. However if i use filezilla I enter the
> while loop and do not time
> out. I am stuck and dont know what to do.
>
>
> //stripped down example
> public FtpletEnum onUploadStart(FtpRequest request,
> FtpResponse response)
> throws FtpException, IOException {
> InputStream is =
> request.getDataInputStream();
>
> while (is.read() > 0) { //command line hangs
> System.out.println( "read Data");
> }
>
> return FtpletEnum.RET_SKIP;
> }
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com