So our system works by storing user images in in user folders, user folders are stored in master user folders which are stored in one folder called client\_folders. 

Everytime I try to build our download script (using php force download) the files that get downloaded with the name of the entire file path 

Example: client\_folder/user\_30/client\_130/image.jpg 

I just want the file to say image.jpg

I have tried several things, explode with array pop, basename() but everytime I try one of these options the variable that the readfile() function reads is empty. 

Now in mysql I am storing the entire file path (file name included) in one column, is this the right way to do this? and how to do I download files without the entire path 

if it helps this is the code that successfully downloads....just with the full path name :(

```
ob_clean();
if(isset($_POST['file_name'])){
$file = $_POST['file_name'];
header("Content-type: application/octet-stream");
header('Content-Disposition: attachment; filename="'.$file.'"');
readfile($file);
exit();
}

```