# PHP unlink file pb

**URL:** <https://forum.kirupa.com/t/php-unlink-file-pb/125699>\
**Category:** Uncategorized\
**Created:** [October 16, 2004, 3:52pm UTC](https://forum.kirupa.com/t/php-unlink-file-pb/125699 "2004-10-16T15:52:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uli](https://avatars.discourse-cdn.com/v4/letter/u/ccd318/32.png) [@Uli](https://forum.kirupa.com/u/Uli)\
**Post date:** [October 16, 2004, 3:52pm UTC](https://forum.kirupa.com/t/php-unlink-file-pb/125699/1 "2004-10-16T15:52:12Z")

</div>

Hello,  
I have a php script that connects to a ftp and uploads a file… But if the file exists, it doesn’t delete it…  
So i added

```php

//Check if logged
if (@ftp_login($conn_id, $ftpuser, $ftppass)) {
//Check if file exist
if (file_exists($destfile)) {
   unlink($destfile);
}}

```

But it didn’t change anything… so what’s the problem??

TiA 🙂
