File uploads successfully however it is 0 bytes
Solution 1
There are three main possibilities attached to that error code. You either don't have permission to upload to that directory, the disk on the server is full, or uploading the file would exceed your user's disk quota.
Ftp 4xx error codes are "Transient Negative Completion reply" codes. In other words, these error codes are returned when the server fails to do something. Specifically, error code 451 indicates that the server could not write to a file.
If it is true that you are able to create files of zero size in the remote directory, then the possibility of a permission error is most likely ruled out.
If you can contact the server's administrator, you should be able to determine the exact problem.
Solution 2
Sounds like a full disk issue. If you have access to the FTP server you can confirm if the disk is full with the following command:
$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda3 76773444 72816084 0 100% /
/dev/hda1 101086 16327 79540 18% /boot
/dev/shm 501628 0 501628 0% /dev/shm
This shows that device /dev/hda3 is full. Additionally you can check in the FTP server's log file:
$ less /var/log/messages
And then search for FTP to find any messages from the server with errors about not being able to write to the disk.
Related videos on Youtube
osoclever
Updated on September 18, 2022Comments
-
osoclever over 1 year
I have an interesting problem where I have the ability to upload files, change permissions, download files using FTP on Cent OS. However, the interesting and annoying part is that the files are completely blank (0 bytes) when they get uploaded.
What might be the trouble here?
Here is the log from the client (FileZilla):
Status: Starting upload of C:\gettweetmodel_dev.php Status: Retrieving directory listing... Command: TYPE I Response: 200 Switching to Binary mode. Command: PASV Response: 227 Entering Passive Mode. Command: LIST -a Response: 150 Here comes the directory listing. Response: 226 Directory send OK. Command: TYPE A Response: 200 Switching to ASCII mode. Command: PASV Response: 227 Entering Passive Mode Command: STOR gettweetmodel_dev.php Response: 150 Ok to send data. Response: 451 Failure writing to local file.
-
osoclever almost 11 yearsHere's a log I've gotten from Filezilla: Status: Starting upload of C:\gettweetmodel_dev.php Status: Retrieving directory listing... Command: TYPE I Response: 200 Switching to Binary mode. Command: PASV Response: 227 Entering Passive Mode. Command: LIST -a Response: 150 Here comes the directory listing. Response: 226 Directory send OK. Command: TYPE A Response: 200 Switching to ASCII mode. Command: PASV Response: 227 Entering Passive Mode Command: STOR gettweetmodel_dev.php Response: 150 Ok to send data. Response: 451 Failure writing to local file. Error: File transfer failed
-
Admin almost 11 yearsMind adding that to your question? Formatting gets messed up in comments.
-
osoclever almost 11 yearsThat appears to be it. It didn't even occur to me that it could be the problem.
-
-
osoclever almost 11 yearsI ran out of hard drive space due to an obnoxious mysql table with millions of records.
-
osoclever almost 11 yearsFilesystem 1K-blocks Used Available Use% Mounted on /dev/xvda1 19609276 18812812 0 100% / tmpfs 250512 0 250512 0% /dev/shm
-
slm almost 11 years@osoclever - yup it's happened to everyone here. Glad you solved it.
-
Revious over 7 yearsit's none of these.. what can I check else? I am the sysadmin :(
-
Jeff Schaller over 6 years