Delete files

For certain roles you have permission to delete files such as PDF and documents.
For certain roles you have permission to delete files such as PDF and documents.

In the latest version (deployed on Kubernetes) we have deployed the module Delete files which gives you possibility to remove files. 

By request only

As default the permissions are not activated and permission must be requested to digital@sobi.com. Only trusted roles with good knowledge should have access to deleting files.

I have permission - how do it do it?

First take into account if you need to get back the URL of the old file (for example if you are trying to replace an old version of a file with a new one) or you just wanna delete the file so it is not accessible anymore.

Just delete the file:

Go to the page /admin/content/files where you should see a new tab.

Delete files tab with arrow

Select the files you wish to delete and press the button Delete files.

Delete files action button and selection of file

 

Get the URL back:

(This right now just works in https://sobi-deutschland.de/ site, if you need this in any other site must be requested to digital@sobi.com.)

Go to admin/content/media click edit on the file you wanna force delete.

Media edit button

Then right click on the document link (pointed in the image below) and copy the link address.

Document link

It will look like follows:

http://sobimulti.lndo.site/sites/default/files/2020-09/2020-09-02_16-58.png

Get the last part and replace the rest for 'public://', so at the end looks like this:

public://2020-09/2020-09-02_16-58.png

Then click 'Delete' to delete that media.

Delete media

And confirm the deletion of the media clicking 'Delete' again.

Then go to 'admin/force_file_delete/form/force_file_delete'

And past the URI into the Public Uri Path field as in the image below:

Force delete

And finally click submit.

Now the if you try to open the original URL, it will say that it does not exist and you can create the media again with a file replacement with that same URL.

Caution

This must be done with care and remember to remove any references to the file in your content before deleting. Deleted files will be permanently removed with no option to regret the action. It is advised you save the file on your computer or cloud storage before removing.