www.webdeveloper.com
Results 1 to 4 of 4

Thread: Delete image from folder inside of the server

  1. #1
    Join Date
    Jul 2012
    Posts
    12

    Delete image from folder inside of the server

    hi everyone.

    i searched about how i can remove a image in a folder inside of my server, i saw that i can use unlink() but it is not working i have the right directory and all the permissions and it says:

    Warning: unlink(URL): No such file or directory in /var/www/some name/some name/social/some name.php on line 33

    and the line 33 have unlink(URL).

    Anyone can give me some help?

    Thanks community

  2. #2
    Join Date
    Jun 2008
    Location
    Europe
    Posts
    1,096
    Perhaps you need to start from the root?

    home/var/www/...etc.

    Or no leading slash.

  3. #3
    Join Date
    Jan 2006
    Location
    MN
    Posts
    440
    I think you have two ways to go; a relative path from the directory the php file is to the image file, or a full path to the image file such as

    unlink("images/imagetodelete.jpg"); //or

    unlink("http://www.mywebsite.com/images/imagetodelete.jpg");

  4. #4
    Join Date
    Jul 2012
    Posts
    12
    Quote Originally Posted by Dasher View Post
    I think you have two ways to go; a relative path from the directory the php file is to the image file, or a full path to the image file such as

    unlink("images/imagetodelete.jpg"); //or

    unlink("http://www.mywebsite.com/images/imagetodelete.jpg");
    Problem resolved, it was replace URL by $URL

    Thanks anyway

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles