Re: unlink problems
| From: | Richard Quadling | Date: | Thu, 26 Nov 2009 15:15:17 +0000 |
| Subject: | Re: unlink problems | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-46661@lists.php.net to get a copy of this message | ||
2009/11/25 Neil Jackson <neil@webcoza.co.za>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
> I use the following to delete a file on a webserver
>
> if( unlink( "./$filename" ) )
> {
> echo $filename." deleted ";
> $action='';
> echo
>
> "<script>document.location.href='$PHP_SELF?action=$action&code=$code'</script>";
> }
>
> But I get the following error
> Warning: unlink(./6 November 2009.pdf): No such file or directory in
> /srv/www/htdocs/bee_partners/admin/tenders.php on line 82 6 November
> 2009.pdf not deleted
>
> Any help?
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.9 (GNU/Linux)
> Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
>
> iEYEARECAAYFAksNBV4ACgkQGgk1S8edB3JqWgCfb61pxGvh+KCXNfNdWgF2kb/P
> xCMAn2dSOgN9AiFYX35Ga00XyxZQwGnw
> =NL6k
> -----END PGP SIGNATURE-----
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
Not exactly sure what help you would need? The file doesn't exist, so
you can't delete it.
But a quick hack later ...
http://www.beepartners.com/tenders/
is where the files are and
http://www.beepartners.com/admin/tenders.php
is where the script it.
So, "./$filename" should probably be "../tenders/$filename" maybe.
Regards,
Richard.
--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling