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

查看:27
本文介绍了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天全站免登陆