Current location: Hot Scripts Forums » Programming Languages » PHP » Question with chown - Change file owner ! Help pls


Question with chown - Change file owner ! Help pls

Reply
  #1 (permalink)  
Old 07-08-03, 12:43 AM
kevin kevin is offline
Newbie Coder
 
Join Date: Jun 2003
Location: USA
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Question with chown - Change file owner ! Help pls

Hello !

This is what I did:

- created folder name "image"
- use FTP to upload .gif + .jpg files inside "image" folder
- I've tried to use the function unlink("",""); to delete the .gif file

Then I got the error message Permission denied

I think I need to change the file owner (or something like that) so that the remove.php script can delete the unwanted file? Is it right?

Please help me how to do that ! Thanks

Please note: If I upload the gif files via my upload.php script then I can use unlink function to delete the unwanted gif file.

Thanks!
Kev
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 07-09-03, 04:55 AM
Chris Boulton Chris Boulton is offline
Wannabe Coder
 
Join Date: Jun 2003
Location: Sydney, Australia
Posts: 208
Thanks: 0
Thanked 0 Times in 0 Posts
I think its because of this.

When you ftp files up to your site they are being chowned (change owner) to your ftp user.

Apache or your webserver is probably running under its own user like apache which does not have permission to remove the files.

Also, it could be that the images directory is not chmod'd to something writable (777 or 666)

Hope that helps
__________________
Chris Boulton
SurfiOnline!
MyBulletinBoard
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 07-09-03, 05:36 AM
Chris Boulton Chris Boulton is offline
Wannabe Coder
 
Join Date: Jun 2003
Location: Sydney, Australia
Posts: 208
Thanks: 0
Thanked 0 Times in 0 Posts
By the way, unlink only takes one argument.. I dont know what that second one is for..
__________________
Chris Boulton
SurfiOnline!
MyBulletinBoard
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP code to edit a text file mdhall Script Requests 12 12-23-10 05:03 AM
New Web Host, New Problem! justchat PHP 2 09-29-03 03:39 PM
Script to change file extensions JavaHead Script Requests 2 09-13-03 10:44 AM
Writes to a text file gamextremer2003 JavaScript 4 09-11-03 10:43 AM
Upload file type and size limiter! Arctic ASP 1 08-02-03 08:06 PM


All times are GMT -5. The time now is 08:17 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.