Unable to rename a file with 777 permissions over FTP
I was working with php's ftp_rename function and getting a permission denied error when renaming the extension of a file to indicate that it had been downloaded.
To make sure it wasn't a php config issue, I tried ftping manually. This is where I'm stumped.
ftp> ls
200 PORT command successful开发者_JAVA技巧. Consider using PASV.
150 Here comes the directory listing.
-rwxrwxrwx 1 1000 1000 179 Oct 18 16:12 File_20101018041300.csv
226 Directory send OK.
ftp> rename File_2010101804300.csv File_20101018041300.csv.downloaded
550 Permission denied.
Any idea's on what's going on?
Make sure you have write permissions on the directory containing the file.
When you rename a file, you modify the directory entry, too.
Renaming requires write privileges on the parent folder rather than the file itself.
It turns out I had to uncomment the following line in /etc/vsftp.conf
#write_enable=YES
精彩评论