I agree. The user in an ftp session is named creator (value 7 of 755), and will not be the same as the localhost user in a PHP script. There are discussions about how to get by this on this site.
They usually recommend setting the permission on a directory to 777 (I don't recommend this because I heard it is introduces a security risk. I don't personally understand this)
Since I heard 777 permission is a bad thing I wrote a script that rewrites a specified set of files and gives them a new name. When the file is written the creator becomes the PHP user (usually localhost) and the file can be written to and read by the PHP script. My script only rewrites .txt files so PHP files don't maliciously change ownership.
Not sure how 777 directory permission introduces a security risk, would like someone with a real grasp on that to let me know.
Hope this helps you...