tags:

views:

44

answers:

3

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. 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?

+3  A: 

Make sure you have write permissions on the directory containing the file.

When you rename a file, you modify the directory entry, too.

adamk
you've got the benefit of being more clear
dvhh
+3  A: 

Renaming requires write privileges on the parent folder rather than the file itself.

Gintautas Miliauskas
+1  A: 

It turns out I had to uncomment the following line in /etc/vsftp.conf

#write_enable=YES
PMV