⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

File uploaded can't be deleted



Laurent Nunenthal

Laurent Nunenthal
  • profile picture
  • Member

Posted 19 February 2017 - 17:39 PM

Hello,the rec

 

I cant upload a file without problem, but when i delete the record in list view the record is deleted but the file stay on the server.

 

I can delete it with php, I test this little script, and this work, so it's seem that is not a server problem.

 

<?php
 
if (unlink ('assets/estimation_image/e0a75-img_4950.jpg'))
{
    echo 'ok';
}
 else 
 {
     echo 'bad';
 }
 ?>
 

The problem is that I have absolutely no error message, what I can doing.

 

Please help.


Laurent Nunenthal

Laurent Nunenthal
  • profile picture
  • Member

Posted 19 February 2017 - 17:55 PM

maybe it's a path problem

 

If I use 

/assets/estimation_image/e0a75-img_4950.jpg'

the file is not found, I don't understand why ?

 

maybe an htaccess problem (I'm not very cool with that)

 

my htaccess

 

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?$1 [L]

 

 

Thank you for your help


Laurent Nunenthal

Laurent Nunenthal
  • profile picture
  • Member

Posted 20 February 2017 - 12:38 PM

So, one more time, I'm stupid, simply this is not automated. 

Need to use callback_before_delete to create a function to delete the file on the server.