The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    6
    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:
     
  2. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    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.
     
  3. jcsolutions

    jcsolutions Well-Known Member

    Joined:
    Nov 4, 2002
    Messages:
    184
    Likes Received:
    0
    Trophy Points:
    16
    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:
    6
    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:
     
  5. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    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:
     
Loading...

Share This Page