4

I have uploaded a new docx and pdf through the media library and the procedure is completed successfully. I can confirm that the direct link actually works.

The problem is being identified when I try to DELETE PERMANENTLY the files.

By clicking on "Delete Permanently", the file record is deleted from the media library, nevertheless the actual file (and its direct link) still resides on disk. On the other hand, Wordpress returns a message that the deletion was completed successfully.

Can you suggest me possible steps to debug the above-mentioned prcedure?

Wordpress 4.7.3 currently resides on IIS 8, with PHP 7.0.x. I have checked some possible user permissions for IUSR, and currently on files is being given full control.

Thank you, Chris

  • I have seen this type of issue when the server "owner" of the file does not match WordPress's user. Even if permissions are set properly the ownership can make the difference. – WebElaine Apr 3 '17 at 15:15
  • Or it could be a caching issue. Do you have a caching plugin installed? – TomC Apr 3 '17 at 15:33
  • @WebElaine Hello! When Wordpress actually uploads the file, it doesn't automatically becomes the owner of the file? – mmystery Apr 3 '17 at 15:43
  • @TomC nope, no caching plugins... But (theoretically), could be unrelated? As the file remains on the actual folder on disk... – mmystery Apr 3 '17 at 15:44
  • mmystery, follow-up on @webelaine comment. Do the files uploaded have a different owner and permission than say your wp-config file? – rudtek Apr 3 '17 at 15:50
6

So, after several attempts... it is a problem (or a feature) of the WPML multilanguage plugin.

  1. To start with, I have set up correctly the user permissions, as @WebElaine mentioned. Just in case something was not configures properly. More information on the following articles:
    Permissions to wp-content folder in Windows Server 2012
    https://www.chillies.co.za/news/4421/The-Correct-Permissions-for-WordPress-on-IIS/
    https://www.customfitonline.com/news/2013/6/20/solve-wordpress-on-windows-server-problems/
  2. In my case, I had installed the WPML Media plugin. With the default behaviour, on each media file that is being uploaded, the plugin creates as many database records as the installed languages.

    When someone navigates in the media library, and "deletes permanently" a file, it just deletes the database record and not the physical file on disk. The user should browse each language (on back-end, the flag on the upper bar), and "delete permanently" the specific file for each language. More info here:
    https://wpml.org/forums/topic/deleting-from-media-library-does-not-delete-from-server/
    http://wpml.org/documentation/getting-started-guide/media-translation/

When the last record is being deleted, then the physical file will be deleted also.

Hope it helps! :)

Chris

  • Thanks! This is the trick :) We need to remove the file for all languages and in my case I dont have the wpml media plugin eather. – hayatbiralem Jan 19 at 12:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.