Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Sep 2007
    Posts
    125
    Thanks
    30
    Thanked 0 Times in 0 Posts

    CHMOD'ing a file when uploading it?

    Hello.

    I created a standard form for people to upload files to my web server from. The problem is that when the files get uploaded, they are not readable. The FOLDER on the server is CHMOD'd to "744", but the FILES get uploaded as "600" (not readable)...

    I would like to know how to get a file uploaded as "744" when using the standard "move_uploaded_file" command?...

    Thanks!!!

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,073
    Thanks
    11
    Thanked 98 Times in 96 Posts
    if apache/php created the files then it can change their permissions ...
    PHP Code:
    <?php chmod($filename0744);?>
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #3
    Regular Coder
    Join Date
    Sep 2007
    Posts
    125
    Thanks
    30
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by firepages View Post
    if apache/php created the files then it can change their permissions ...
    PHP Code:
    <?php chmod($filename0744);?>
    I used the "chmod" function, and if I log into my FTP server, I can see that the permissions on the file are now what I want them to be. However, the file still isn't readable for whatever reason!...

    Any ideas???

  • #4
    Regular Coder
    Join Date
    Sep 2007
    Posts
    125
    Thanks
    30
    Thanked 0 Times in 0 Posts
    EDIT: - NEVERMIND!!!

    I needed to have the folder that the files were going into set to have "Execute" permissions. Thanks!!!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •