Question: While installing `oracle-java7-installer` via `ppa:webupd8team/java` repository, I see the following error:

```
dpkg: error processing /var/cache/apt/archives/oracle-java7-installer_7u25-0~webupd8~1_all.deb (--unpack):
 trying to overwrite '/usr/share/applications/JB-java.desktop', which is also in package oracle-java6-installer 6u37-0~eugenesan~precise1
Errors were encountered while processing:
 /var/cache/apt/archives/oracle-java7-installer_7u25-0~webupd8~1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

```

Do I need to delete the file `/usr/share/applications/JB-java.desktop` manually to make this installation work?

Answer: 
Use [fopen](http://php.net/manual/en/function.fopen.php) function

```
if (@fopen($resultUF['destination'], "r")) {
    echo "File Exist";
} else {
    echo "File Not exist";
}

```
you can use `file_get_contents`. This will cause php to issue a warning along side of returning `false`. You may need to handle such warning display to ensure the user interface doesn't get mixed up with it.

```
 if (file_get_contents($url) === false) {
       //image not foud
   }

```