FTP文件上传不起作用-上传空文件 [英] FTP File Upload doesn't work - uploads empty files

查看:657
本文介绍了FTP文件上传不起作用-上传空文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的问题.我必须编辑一个网站的文件.客户端给了我ftp数据.

Here's my problem. I have to edit the file of a website. The client gave me the ftp data.

连接后,一切正常,直到我要编辑文件为止.当我完成编辑并想要保存它时,它被服务器上的一个空文件替换.我再次尝试了几次,结果相同.

When I connect everything works fine until I wanted to edit the file. When I was done editing and wanted to save it, it got replaced with an empty file on the server. I tried again several times, same results.

因此,我尝试在计算机上写入文件并上传.仍然会上传一个空文件.

So then I tried writing the file on my computer and uploading it. It still uploads an empty file.

我随机尝试上传任何东西,例如图像,并且上传了一个0字节的.jpg.

I randomly tried uploading anything, like an image, and it uploads a .jpg that's 0 bytes.

以前有人遇到过这种情况吗,还是有人知道原因可能是什么以及如何解决?

Has anyone encountered something like this before, or does anyone know what the cause may be and how it can be fixed?

推荐答案

哇,自被问起以来已经很长时间了,但是以防万一有人遇到类似的问题...

Wow, it's really long time since this has been asked, but just in case someone has a similar problem...

FTP通信同时发生在两个单独的连接上,一个在端口21(控制端口)上,一个在> 1023(数据传输端口)上. 如果在连接到服务器并在服务器上导航时观察到正常行为,但是传输后上传/下载的文件没有内容(大小为0kB),则一种可能性是数据传输连接被防火墙阻止,而控制连接不是.

FTP communication happens simultaneously on two separate connections, one on port 21 (control port) and one on a port >1023 (data-transfer port). In case you obeserve a normal behaviour when connecting to and navigating on the server, but uploaded/downloaded files have no content (size of 0kB) after the transfer, then one possibility is that the data-transfer connection is blocked by the firewall, whereas the control connection isn't.

如果可能,请尝试使用被动模式进行客户端连接,或者检查并打开防火墙设置.

If possible, try to use passive mode for the connection on the client side, or check and open up your firewall settings.

这篇关于FTP文件上传不起作用-上传空文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆