use MODE Z can not upload correctly ,why?

Moderator: Project members

Post Reply
Message
Author
zhuhe
500 Command not understood
Posts: 4
Joined: 2014-11-30 03:41
First name: zhu
Last name: he

use MODE Z can not upload correctly ,why?

#1 Post by zhuhe » 2014-11-30 04:02

Problem is as follows:
I use FileZilla Server as the file manager server. While uploading file, I usually split one file into small pages and upload every page to FileZilla Server in turn. when uploading file without using MODE Z protocol, I can upload the whole file successfully. While uploading file with using MODE Z protocol, I use zlib algorithm compress each page of one file then uploading each page in turn, but the FileZilla Server can only uncompress the first page of the file. Could you please tell me where is wrong?

May you everthing goes well, thank you.

User avatar
boco
Contributor
Posts: 26913
Joined: 2006-05-01 03:28
Location: Germany

Re: use MODE Z can not upload correctly ,why?

#2 Post by boco » 2014-11-30 05:36

MODE Z works automatically and transparently, if supported by both client and server (e. g. FileZilla Client does NOT support MODE Z). You do not need to do anything beforehand. FileZilla Server cannot unpack archives, neither can FileZilla Client - FTP doesn't support such functionality.

If you mean something different, please elaborate.
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org

zhuhe
500 Command not understood
Posts: 4
Joined: 2014-11-30 03:41
First name: zhu
Last name: he

Re: use MODE Z can not upload correctly ,why?

#3 Post by zhuhe » 2014-11-30 11:05

boco wrote:MODE Z works automatically and transparently, if supported by both client and server (e. g. FileZilla Client does NOT support MODE Z). You do not need to do anything beforehand. FileZilla Server cannot unpack archives, neither can FileZilla Client - FTP doesn't support such functionality.

If you mean something different, please elaborate.

I use one FTP client uploading file. This FTP client is programed with windows API. I want to upload files using compressed data in order to adapt low-bandwidth communications link. Uploading file procedure is as follows: First, I send MODE Z command to FileZilla Server in order to use MODE Z protocol. Second, I split the file needed to upload to FileZilla Server into small pages, such as 4K one page. Third, I use zlib algorithm compress each page and send each page in turn to FileZilla Server. But FileZilla Server can only uncompress the first page of the file, FileZilla Server can not uncompress other pages, I do not understand why, so I want to help, thank you very much.

User avatar
botg
Site Admin
Posts: 35508
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: use MODE Z can not upload correctly ,why?

#4 Post by botg » 2014-11-30 13:22

Please post a log of both the working and the failing transfer.

zhuhe
500 Command not understood
Posts: 4
Joined: 2014-11-30 03:41
First name: zhu
Last name: he

Re: use MODE Z can not upload correctly ,why?

#5 Post by zhuhe » 2014-12-01 07:52

botg wrote:Please post a log of both the working and the failing transfer.

Uploading file size is 33.2k, the file name is 1_1.plt. I split it into small pages, each size is 4k. When I do not use MODE Z, the file can upload to FileZilla Server successfully. Server log is as follows:

(000029) 2014-12-1 15:29:09 - (not logged in) (168.168.9.82)> USER admin
(000029) 2014-12-1 15:29:09 - (not logged in) (168.168.9.82)> 331 Password required for admin
(000029) 2014-12-1 15:29:09 - (not logged in) (168.168.9.82)> PASS ****
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> 230 Logged on
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> OPTS UTF8 OFF
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> 200 UTF8 mode disabled
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> CWD \
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> 250 CWD successful. "/" is current directory.
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> CWD \LzCacheTemp
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> 250 CWD successful. "/LzCacheTemp" is current directory.
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> CWD \LzCacheTemp
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> 250 CWD successful. "/LzCacheTemp" is current directory.
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> TYPE I
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> 200 Type set to I
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> PASV
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> 227 Entering Passive Mode (168,168,10,53,18,224)
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> STOR LzCacheTemp_EC8C6B85-BDEA-451B-AC05-16ACD01A0FC2
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> 150 Connection accepted
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> 226 Transfer OK
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> CWD \
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> 250 CWD successful. "/" is current directory.
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> DELE 1_1.plt
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> 250 File deleted successfully
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> RNFR \LzCacheTemp\LzCacheTemp_EC8C6B85-BDEA-451B-AC05-16ACD01A0FC2
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> 350 File exists, ready for destination name.
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> RNTO 1_1.plt
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> 250 file renamed successfully
(000029) 2014-12-1 15:29:09 - admin (168.168.9.82)> disconnected.


While uploading the same file with MODE Z, the FileZilla Server can only uncompress one page. Only the first page can uncompress. Server log is as follows:


(000027) 2014-12-1 15:26:35 - (not logged in) (168.168.9.82)> USER admin
(000027) 2014-12-1 15:26:35 - (not logged in) (168.168.9.82)> 331 Password required for admin
(000027) 2014-12-1 15:26:35 - (not logged in) (168.168.9.82)> PASS ****
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> 230 Logged on
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> OPTS UTF8 OFF
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> 200 UTF8 mode disabled
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> MODE Z
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> 200 MODE set to Z.
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> CWD \
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> 250 CWD successful. "/" is current directory.
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> CWD \LzCacheTemp
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> 550 CWD failed. "/LzCacheTemp": directory not found.
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> MKD \LzCacheTemp
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> 257 Directory created successfully
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> CWD \LzCacheTemp
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> 250 CWD successful. "/LzCacheTemp" is current directory.
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> TYPE I
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> 200 Type set to I
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> PASV
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> 227 Entering Passive Mode (168,168,10,53,5,208)
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> STOR LzCacheTemp_42929C80-AFCE-4FE5-9C4F-B06936B4724A
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> 150 Connection accepted
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> 226 Transfer OK, compression saved 2393 of 4096 bytes (58.43%)
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> CWD \
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> 250 CWD successful. "/" is current directory.
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> DELE 1_1.plt
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> 550 File not found
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> RNFR \LzCacheTemp\LzCacheTemp_42929C80-AFCE-4FE5-9C4F-B06936B4724A
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> 350 File exists, ready for destination name.
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> RNTO 1_1.plt
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> 250 file renamed successfully
(000027) 2014-12-1 15:26:35 - admin (168.168.9.82)> disconnected.

User avatar
botg
Site Admin
Posts: 35508
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: use MODE Z can not upload correctly ,why?

#6 Post by botg » 2014-12-01 08:10

You are using an outdated version of FileZilla Server. Please update to the most recent version.

zhuhe
500 Command not understood
Posts: 4
Joined: 2014-11-30 03:41
First name: zhu
Last name: he

Re: use MODE Z can not upload correctly ,why?

#7 Post by zhuhe » 2014-12-02 06:07

botg wrote:You are using an outdated version of FileZilla Server. Please update to the most recent version.
I have used the newest FileZilla Server whose version is 0_9_48, however, the result is all the same that the file can only uncompress the first page of one file. So, I use VS2005 to debug FileZilla source code in order to find what is happen. During debugging the programes I find that the CTransferSocket class in FileZilla Server source code uses one class member z_stream m_zlibStream to compress or to uncompress transfered data. When the first use of m_zlibStream, the state of m_zlibStream is correct, so the FileZilla Server can compress or uncompress transfered data correctly. But when the second or other times use of m_zlibStream, because of lacking reset the state of m_zlibStream, such as is lack of calling inflateReset(&m_zlibStream) to reset the state of m_zlibStream after call CTransferSocket::OnReceive or CTransferSocket::OnSend, so the state m_zlibStream is always not usable, then the other pages can not compress or uncompress correctly. is there one bug in FileZilla Server source code? I am not sure. Could you please give me a reasonable explaination?

Thank you very much, waitting for your reply sincerely.

User avatar
botg
Site Admin
Posts: 35508
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: use MODE Z can not upload correctly ,why?

#8 Post by botg » 2014-12-02 09:15

That doesn't seem to be an issue. The transfer was successful after all, as can be seen in the log you posted.

Post Reply