View previous topic :: View next topic |
Author |
Message |
murfituk -
Joined: 03 May 2007 Posts: 2
|
Posted: Mon May 19, 2008 11:10 am Post subject: unlink (php file deletion won't work) |
|
|
Got a script that takes a few jpgs, adds watermarks, saves the new images in a folder, takes all the images and puts them in a zip. Then the script goes through and unlinks all the new jpgs. Can delete them because they are now all zipped up.
Get a warning about not having permission to delete eg
Warning: unlink(users/5120204.jpg) [function.unlink]: Permission denied in C:\Program Files\Abyss Web Server\htdocs\WebSites\Contacts\createzip.php on line 58
Everything else works OK. it's just the files don't get deleted. I can put a @ in front of unlink to supress the warning but it only hides the problem.
What do I have to do? I've got a windows XP, abyss X1 v2.4, PHP 5.2.1. I've tried right-clicking the users folder and untick Read Only, but to no avail.
Many thanks. |
|
Back to top |
|
|
chewzzqq -
Joined: 28 Sep 2005 Posts: 198
|
Posted: Mon May 19, 2008 4:15 pm Post subject: |
|
|
i think other is still browsing to it,
so it cant be delete ?
or you just restart you system ,and try to delete again? _________________
|
|
Back to top |
|
|
Toasty -
Joined: 21 Feb 2008 Posts: 298 Location: Chicago, IL
|
Posted: Mon May 19, 2008 11:46 pm Post subject: |
|
|
Make sure that the scripts that you're using close the file resource before it tries to delete the files.
If it does, and you're still getting problems, you might have a permission issue coming from your PHP.INI...But where that would lye, I'm not sure.
Look into this command:
imagedestroy();
See if that suits your needs.
-Toasty _________________ Audit the secure configuration of your server headers! |
|
Back to top |
|
|
murfituk -
Joined: 03 May 2007 Posts: 2
|
Posted: Tue May 20, 2008 2:41 am Post subject: |
|
|
Toasty - you were spot on.
I was in a for loop (from 1 to number_of_pages),
creating the watermarked image using a function, saving it, putting it in the zip and then trying to delete the image. Wouldn't work.
Had to close the zip first and then create a second loop to go through and delete 'em. |
|
Back to top |
|
|
Toasty -
Joined: 21 Feb 2008 Posts: 298 Location: Chicago, IL
|
|
Back to top |
|
|
|