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 6 of 6
  1. #1
    Regular Coder
    Join Date
    Apr 2010
    Posts
    417
    Thanks
    4
    Thanked 1 Time in 1 Post

    rename not renaming files.

    Unable to rename my files.

    this is the error i get.

    Code:
    Warning: rename("/photos/7d5559ba623135639b055f4de96187cd.jpg","/photos/old.jpg") [function.rename]: No such file or directory in
    i have tried both...

    /home/site/public_html/photos/

    and just the photos folder but none work.

    how do i correctly change the name of the file?

    i have set permissions of the folder photos to 0777

  • #2
    Regular Coder
    Join Date
    Jul 2009
    Posts
    187
    Thanks
    16
    Thanked 8 Times in 8 Posts
    The file doesn't exist at the location being stated, try placing the file in the root directory and then try renaming the script. (To verify that its not a code problem).

  • #3
    Regular Coder
    Join Date
    Apr 2010
    Posts
    417
    Thanks
    4
    Thanked 1 Time in 1 Post
    Quote Originally Posted by Jazz914 View Post
    The file doesn't exist at the location being stated, try placing the file in the root directory and then try renaming the script. (To verify that its not a code problem).
    strange as i view the page of the full path shown on screen and the photo shows in the browser?

  • #4
    New Coder
    Join Date
    May 2006
    Posts
    81
    Thanks
    0
    Thanked 11 Times in 11 Posts
    Files on a server are part of the file system and so maybe in different folders to the files on the webserver which are relative to the webroot.

  • #5
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    Quote Originally Posted by jasonpc1 View Post
    Unable to rename my files.

    this is the error i get.

    Code:
    Warning: rename("/photos/7d5559ba623135639b055f4de96187cd.jpg","/photos/old.jpg") [function.rename]: No such file or directory in
    i have tried both...

    /home/site/public_html/photos/

    and just the photos folder but none work.

    how do i correctly change the name of the file?

    i have set permissions of the folder photos to 0777
    Are you certain that there is no other folder between the www root (public_html) and the photos folder? If, for example, you have a hosting account with multiple domain names and/or subdomains you might have each site in a different folder.
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • #6
    Regular Coder
    Join Date
    Jul 2009
    Posts
    187
    Thanks
    16
    Thanked 8 Times in 8 Posts
    Create a php file in the photos folder and add the following code:
    PHP Code:
    <?php echo($_SERVER['SCRIPT_FILENAME']); ?>
    and tell us what you get, or adjust your folder link as demonstrated ^_^


  •  

    Posting Permissions

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