Compression issues - WeOnlyDo Discussion board

Compression issues (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Roman, Thursday, April 12, 2007, 14:14 (6247 days ago)

I have question,
before invoke 'connect' method I set 'compression' property to 6.
After connect to server 'compression' property change to 0 ( maybe because server doesn't support compression ).
Next in marked lines I have exception Syntax error, command unrecognized. . If try once more execute this line, it execute correctly.
In log appear lines :

GetServerResponse returned 500
Command: OPTS MODE Z LEVEL 3 500 'OPTS MODE Z LEVEL 3': command not understood.

My JScript code:
[code]
var ftp = new ActiveXObject( WeOnlyDo.wodFtpDLXCom );
ftp.DebugFile = d:/debug.log ;
ftp.blocking = true;
ftp.hostname = ... ;
ftp.login = ... ;
ftp.password = ... ;

ftp.passive = false;
ftp.connect();

ftp.compression = 7;
ftp.listDir( / );

ftp.compression = 4;
ftp.listDir( / ); // HERE EXCEPTION

ftp.compression = 3;
ftp.listDir( / ); // HERE EXCEPTION

ftp.disconnect();
[/code]

Questions:
1) What meen change 'compression' to 0 after connect?
2) Why raise exceptions on ListDir?

Re: Compression issues

by woddrazen, Thursday, April 12, 2007, 15:20 (6247 days ago) @ Roman

Hi Roman,


Your server probably doesn't support compression. You have receive command not understood when MODE Z command is send.

I have just tried your code with Serv-U FTP server which support compression and everything worked like a charm.

You can send us full FtpReply if you like. FtpReply will give us more details about compression problem.

Here is example how to done that:
[code]
Private Sub ftp_FTPReply(ByVal Command As String, ByVal ReplyCode As Integer, ByVal ReplyText As String)
Debug.Print Command & & ReplyText
End Sub
[/code]

Hope I helped.


Regards,
Drazen

Re: Compression issues

by Roman, Thursday, April 12, 2007, 15:51 (6247 days ago) @ woddrazen

Hi woddrazen,
I guess that my server doesn't support compression...problems in exception in 2nd and 3rd try invoke ListDir, but not in 1st.
For me good way not receive exception about such errors in ListDir method, or receive but with results of ListDir and corresponding error code ( because it's not so critical error ). Of course, it's all my IMHO :)

Here FTPReplays:
1) 1st execute ListDir
TYPE A - 200 Type set to A.
MODE Z - 500 'MODE Z': command not understood.
CWD / - 250 CWD command successful.
PORT 10,1,1,18,10,70 - 200 PORT command successful.
LIST -al - 150 Opening ASCII mode data connection for '/bin/ls'.
LIST -al - 226 Transfer complete.
2) 2nd or 3rd execute
TYPE A - 200 Type set to A.
OPTS MODE Z LEVEL 3 - 500 'OPTS MODE Z LEVEL 3': command not understood.

I hope this help solve problem.

Thanks, Roman

Re: Compression issues

by woddrazen, Thursday, April 12, 2007, 16:03 (6247 days ago) @ Roman

Roman,


Your server isn't accepting MODE Z command which is used to enable compression.

What happened if you remove Compression Property lines from your code?


Drazen

Re: Compression issues

by Roman, Thursday, April 12, 2007, 16:14 (6247 days ago) @ woddrazen

woddrazen,
If remove lines whre change compression nothing happen, work fine with no exception.
And if disconnect/connect and again change compression than 1st execution on ListDir still no exception, but not for next.

Thanks, Roman

Re: Compression issues

by wodDamir, Saturday, April 14, 2007, 22:04 (6245 days ago) @ Roman

Hi Roman,

So it works fine if you remove compression?

Since your server doesn't doesn't support Compression, you will have to completely remove Compression Property from your code. If you try to change it, the error will occur again.

Regards,
Damba