/    Sign up×
Community /Pin to ProfileBookmark

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

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@donatelloAug 12.2012 — Perhaps you need to start from the root?

home/var/www/...etc.

Or no leading slash.
Copy linkTweet thisAlerts:
@DasherAug 12.2012 — 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");
Copy linkTweet thisAlerts:
@Alex1234authorAug 12.2012 — 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");[/QUOTE]


Problem resolved, it was replace URL by $URL ?

Thanks anyway
×

Success!

Help @Alex1234 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...