How to delete remote file thorugh PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mskulkarni10
Forum Newbie
Posts: 1
Joined: Fri Dec 26, 2003 3:23 am
Contact:

How to delete remote file thorugh PHP

Post by mskulkarni10 »

Hello,
I have problem in deleting the image on the remote server through PHP. Images is uploaded on the remote server through the servelt. When I tries to delete image using "Ulink", I got error "permission denied". I have serached for help on the web, and tried to use umask and chmod command. Still I am not able to delete file. I set the umask to "0777" and given the permission using "chmod". Still I am not able to delete the file.
The server is Sun server with solaris 5.9.

Cqan anybody knows abt it?

Thanks.
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post by AVATAr »

who's the owner of that file? (chown)
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

to delete the file you must have write permission on directory containing that file.
Jim
Forum Contributor
Posts: 238
Joined: Fri Apr 19, 2002 5:26 am
Location: Near Austin, Texas

Post by Jim »

I'm betting that when he uploads the image to the server, it's owner is set to 0 and it's permissions are set to 0.

Which means that the files can't be deleted by ANYone.

I'm not sure you can change permissions through PHP on a remote server.
Post Reply