FubarDevelopment / FtpServer

Portable FTP server written in .NET
http://fubardevelopment.github.io/FtpServer/
MIT License
473 stars 161 forks source link

Uploading file name is unreadable #78

Closed yuanrui closed 5 years ago

yuanrui commented 5 years ago

The attachments has two same picture, naming Chinese with different, the file "设备管理.png" can uploaded, the file "设备管理-摄像机管理-w.png" will not. It`s so strange, I debug the source code, and unsolved.

The following message may be helpfull:

Collected data: 53544F5220E8AEBEE5A487E7AEA1E790862DE69184E5838FE69CBAE7AEA1E7903F772E706E670D0A
STOR 设备管理-摄像机管�?w.png

Collected data: 44454C4520E8AEBEE5A487E7AEA1E790862DE69184E5838FE69CBAE7AEA1E790
Collected data: 862D772E706E670D0A
DELE 设备管理-摄像机管理-w.png

testfile.zip FubarDev.FtpServer version is 3.0.1

fubar-coder commented 5 years ago

The delete command seems to be fine, but the STOR command doesn't, which makes it unlikely that it's a problem with the FTP server, because the code is the same and it really looks like the sender sent the wrong file name.

Which FTP client do you use? Do you use Windows or Linux on the client/server?

I used Windows 10 as client and the same computer as server (listening on localhost) with the FileZilla client, and everything worked as expected.

EDIT: A test with WinSCP was successful too.

yuanrui commented 5 years ago

OS is Windows 7, ftp client and server in same computer, copy file to server has this problem. Here is screenshot: upload-test

The STOR command file name has invalid chars, so report error.

yuanrui commented 5 years ago

I use FileZilla FTP Client upload file to server, successed.

Collected data: 53544F5220E8AEBEE5A487E7AEA1E790862DE69184E5838FE69CBAE7AEA1E790
Collected data: 862D772E706E670D0A
STOR 设备管理-摄像机管理-w.png
Task System.Threading.Tasks.ValueTask`1+ValueTaskSourceAsTask[System.Boolean] completed
Waiting for 2 tasks
NGettext: Translation not found for message id "Opening connection for data transfer.".
NGettext: Translation not found for message id "Uploaded file successfully.".
Task System.Threading.Tasks.UnwrapPromise`1[System.Threading.Tasks.VoidTaskResult] completed
Waiting for 1 tasks
Collected data: 504153560D0A
PASV
Task System.Threading.Tasks.ValueTask`1+ValueTaskSourceAsTask[System.Boolean] completed
NGettext: Translation not found for message id "Entering Passive Mode ({0}).".
Waiting for 1 tasks
Collected data: 4D4C53440D0A
MLSD
Task System.Threading.Tasks.ValueTask`1+ValueTaskSourceAsTask[System.Boolean] completed
NGettext: Translation not found for message id "Opening data connection.".
NGettext: Translation not found for message id "Closing data connection.".
Waiting for 1 tasks
Collected data: 504153560D0A
PASV
Task System.Threading.Tasks.ValueTask`1+ValueTaskSourceAsTask[System.Boolean] completed
NGettext: Translation not found for message id "Entering Passive Mode ({0}).".
Waiting for 1 tasks
Collected data: 4D4C53440D0A
MLSD
Task System.Threading.Tasks.ValueTask`1+ValueTaskSourceAsTask[System.Boolean] completed
NGettext: Translation not found for message id "Opening data connection.".
NGettext: Translation not found for message id "Closing data connection.".
Waiting for 1 tasks
线程 0x4ec4 已退出,返回值为 0 (0x0)。
线程 0x340c 已退出,返回值为 0 (0x0)。
线程 0xf80 已退出,返回值为 0 (0x0)。
线程 0x495c 已退出,返回值为 0 (0x0)。
线程 0x4ff0 已退出,返回值为 0 (0x0)。
线程 0x34fc 已退出,返回值为 0 (0x0)。
线程 0x44e4 已退出,返回值为 0 (0x0)。
引发的异常:“System.OperationCanceledException”(位于 System.Private.CoreLib.dll 中)
引发的异常:“System.OperationCanceledException”(位于 System.Private.CoreLib.dll 中)
引发的异常:“System.OperationCanceledException”(位于 System.Private.CoreLib.dll 中)
引发的异常:“System.OperationCanceledException”(位于 System.Private.CoreLib.dll 中)
引发的异常:“System.OperationCanceledException”(位于 System.Private.CoreLib.dll 中)
Task System.Threading.Tasks.ValueTask`1+ValueTaskSourceAsTask[System.Boolean] completed
引发的异常:“System.OperationCanceledException”(位于 System.Private.CoreLib.dll 中)
引发的异常:“System.OperationCanceledException”(位于 System.Private.CoreLib.dll 中)
引发的异常:“System.OperationCanceledException”(位于 System.Private.CoreLib.dll 中)
引发的异常:“System.OperationCanceledException”(位于 System.Private.CoreLib.dll 中)
引发的异常:“System.OperationCanceledException”(位于 System.Private.CoreLib.dll 中)
引发的异常:“System.OperationCanceledException”(位于 System.Private.CoreLib.dll 中)
线程 0x3de0 已退出,返回值为 0 (0x0)。
线程 0x3d58 已退出,返回值为 0 (0x0)。
线程 0x31a4 已退出,返回值为 0 (0x0)。
线程 0x4244 已退出,返回值为 0 (0x0)。
fubar-coder commented 5 years ago

Ok, so the problem is inside the Windows 7 FTP client. Sorry, there is nothing I can do about this.

I'll take a look at it again, if you can make this work with other FTP servers, but I seriously doubt it.

yuanrui commented 5 years ago

Yeah, you are right. I set up FileZilla Server for test, has same problem. Anyway, thanks.

image