Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

File Uploads with a script

Discussion in 'General Discussion' started by RedFutura, Aug 9, 2003.

  1. RedFutura

    RedFutura Well-Known Member

    Joined:
    Jun 11, 2003
    Messages:
    72
    Likes Received:
    0
    Trophy Points:
    156
    Hello,

    When I use a script to upload files they are uploaded as user nobody (which is correct) but the problem is that I cannot delete those files using FTP.

    I am using PureFTP. How can I allow users to manage files which have user nobody (or apache)?

    Thanks

    cPanel.net Support Ticket Number:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    4
    Trophy Points:
    343
    Location:
    ON, Canada
    Sounds like the upload script isn't working right. I use an upload script on some of my sites and the script runs as the user and therefore uploads files as the user. If you're using a script that uploads as something other than user, you should probably edit it to do a chown on the file after it's uploaded.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. jcsolutions

    jcsolutions Well-Known Member

    Joined:
    Nov 4, 2002
    Messages:
    184
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Canada
    What if it's a php script? They run as nobody.

    I ran into a similar problem as RedFutura a while back. All uploaded files were owned by 'nobody' so I couldn't easily delete them. I had to delete them through a script. Since I didn't need to remove them often, this wasn't a problem.

    This would solve the issue. :) Don't know why I didn't think of it. I guess it wasn't that big a deal. Oh well.
     
    #3 jcsolutions, Aug 9, 2003
    Last edited: Aug 9, 2003
  4. RedFutura

    RedFutura Well-Known Member

    Joined:
    Jun 11, 2003
    Messages:
    72
    Likes Received:
    0
    Trophy Points:
    156
    The problem is that the chown function in php only allows the superuser to change the user of the file. How can I tell PHP to upload the file with another user?

    cPanel.net Support Ticket Number:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    4
    Trophy Points:
    343
    Location:
    ON, Canada
    I wish I knew php, but when I started studying it last year, I found out I'm too old. :eek:

    Seriously. Between javascript, cgi, telnet, server management, and several other things I'm trying to get better at, I noticed that when I started studying php it affected the other subjects. I started needing to check references more often. Until I know the rest like the back of my hand, ;) I'm not studying php. I give another person any php work I need done. My brain seems to be at it's limit for absorbing new material. :rolleyes:

    Are you an end user, or do you have root access? If you have root access, you could always write a script to run as root that will change the ownership and use cron to run it every hour or so. There's probably a better solution, but someone who knows php may have to provide it.

    cPanel.net Support Ticket Number:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice