NYCPHP Meetup

NYPHP.org

[nycphp-talk] Overwriting files with copy()

Randal Rust randalrust at gmail.com
Mon May 7 09:54:12 EDT 2007


We have a new site that we just set up. We had everything set up on a
test server and then moved to production over the weekend, when we ran
into an odd issue.

We have several areas where users can upload files (PDF, XLS, etc)
into the system. The client found that they needed to update a few of
the files after the move, and some were uploaded and overwrote the old
file with no problems. Others failed for some reason.

When we looked into it further, we found that files uploaded to this
location were overwritten, as they should be:

/root/uploads/2/files/

But files on this path were not getting overwritten.

/root/uploads/2/files/documents

We get a permission denied error from the copy() function.

There are only three files in question, so it's not a huge deal, but I
was suprised that this happened. All of the folder file attributes are
set correctly, but the only way I can get the old file to update
properly is to set the attributes of the actual file to '777.'

-- 
Randal Rust
R.Squared Communications
www.r2communications.com



More information about the talk mailing list