简体   繁体   English

如何通过FTP列出名称中包含空格的目录?

[英]How to list a directory that has whitespaces in its name via FTP?

Well I tried to send the url encoded but when I start the stream I get 550 error (permission denied, which means that the folder doesn't exist in my case -> probably it compares with the non encoded name on the server). 好吧,我尝试发送经过编码的url,但是当我启动流时,出现550错误(权限被拒绝,这意味着在我的情况下该文件夹不存在->可能与服务器上未编码的名称进行比较)。 I tried to send it unencoded...and it failed even quicker, the stream didn't opened at all (naturally). 我试图将其发送为未编码...并且它甚至更快地失败了,流根本没有打开(自然)。 I take it that it's impossible to list a directory that has whitespaces? 我认为不可能列出具有空格的目录?

I'm using a Linux server, but ideally, I would like it to work with multiple servers. 我正在使用Linux服务器,但是理想情况下,我希望它可以与多台服务器一起使用。

[UPDATE] I've just tried the apple sample SimpleFTP code and it seems that it has the same problem. [更新]我刚刚尝试了苹果示例SimpleFTP代码,看来它有同样的问题。 It creates folders with spaces, but when you try to list them it fails 它创建带空格的文件夹,但是当您尝试列出它们时失败

I don't know too much about NSStream, I am using FTPHelper by Erica Sadun for ftp'ing, but I presume that the URL either needs to be escaped. 我对NSStream不太了解,我正在使用Erica Sadun的FTPHelper进行ftp'ing,但我认为URL都需要转义。

Try %20 or \\ where the spaces are meant to be. 尝试%20\\表示空格。 There is meant to be a space after the \\ by the way! 顺便说一句,在\\之后应该有一个空格!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM