upload icon indicating copy to clipboard operation
upload copied to clipboard

Image deletion

Open luceos opened this issue 8 years ago • 2 comments

There are a few cases we need to take care of image deletion;

  • Discussion or post creation was cancelled even though we've uploaded the file.
  • Delete images once the post they contain is deleted (including when the whole discussion was deleted). This only happens on hard deletion (delete forever in Flarum terminology).
  • Delete images that have been removed from the filesystem. We might need to replace these with an obvious text or a "404" image.

luceos avatar Nov 04 '16 06:11 luceos

In a system that we've built/are building we save all uploaded images which are also viewable in an image gallery by the user. Optionally the user can move images to public gallery folders which can be accessed from their user profile.

If an image is used in a user profile or post this is recorded in the database. This makes it easy for users to clean up orphaned images and you can properly deal with deleted images in topics.

BartVB avatar Aug 09 '17 18:08 BartVB

+1 ❤ Imgur image Deletion https://api.imgur.com/endpoints/image/#image-delete

Hari-Bonda avatar May 31 '21 10:05 Hari-Bonda

This issue is open for 7 years and there is still no possibility to delete uploaded data?

I find it fatal, that users can upload stuff and then hide it with the trash icon (why is that even a thing?). It can be even hidden from the admin, because admins do not see hidden media in the user profile, even if they have the permission (View user uploads).

Imagine someone uploads pedophile material on your server, hides it, shares the links to other pedophiles and no admin/mod will ever notice it.

Is there currently a way to completely delete a file in an emergency right now? For example, if an admin sees illegal material and MUST delete it instantly.

therealmaxmoon avatar Aug 30 '23 14:08 therealmaxmoon

Part of this has been implemented through the mapping+cleanup process.

See https://github.com/FriendsOfFlarum/upload#mapfilescommand to implement.

If there's any infringing material, use the post edit feature to remove the image/file from the post, then the command will automatically delete the file. Same if a file is never successfully posted, it will end up deleted.

If you are worried about users using Flarum as a CDN until the cleanup process runs, you can also configure your webserver in a way where hotlinking is prevented. This way it will be very unpractical for anyone to use your forum as a file hosting service.

clarkwinkelmann avatar Aug 30 '23 14:08 clarkwinkelmann

The feature request has been completed in the latest release (as Clark points out). Closing.

@therealmaxmoon if you need a new feature, eg remove files on this post, without deleting the post (as Clark mentions), then do create a new feature request as a new issue.

luceos avatar Aug 30 '23 16:08 luceos

Part of this has been implemented through the mapping+cleanup process.

I had some issues to execute those commands, but I've created a new issue for this.

you can also configure your webserver in a way where hotlinking is prevented.

hmmm... I thought hotlink prevention is activated as a default or what exactly does this option do if it's not activated?:

image

But after embedding pictures on another website from my forum the images showed up and hotlinking was possible.

After a while I figured out I have to add the hotlink prevention before including the .nginx.conf, which was provided by flarum.

I added search engines to the white list, but still don't know if it's a good or bad idea?

server {
	location ~* \.(?:jp?g|gif|png|webp)$ {
		valid_referers none blocked ~.google. ~.bing. ~.yahoo. ~.duckduckgo. ~.ecosia. ~.qwant. ~.startpage. ~.metager. utopify.org *.utopify.org;
	    	if ($invalid_referer) {
			return   403;
		}
	}
	include /var/www/flarum/.nginx.conf;
        [...]

therealmaxmoon avatar Aug 30 '23 23:08 therealmaxmoon

I can't delete the photos I uploaded on the Shared uploads on my flarum forum. Every time I try deleting it, I get an error saying "Could not delete file"

Help please. Also when I try deleting it using the Imgur API using my client-ID, I get a 403 Error, says Unauthorized.

Digital-XxX avatar Apr 04 '24 11:04 Digital-XxX