I wanted to know how to delete files when we don’t want them. Like sometimes users upload large size files and upload multiple copies of the same file. How can I delete the repeatedly uploaded items and keep my disk space clean? We run a blogging community forum at http://ask.mybloggertricks.com and we often need to upload graphic images and some css files
There is no way to delete files from the UI currently.
There is a cleanup task that automatically removes images which are no longer referenced in any Discourse post. It’s something @zogstrip added a year+ ago.
That is weird but at least I am glad the cleanup task exists. Images and uploaded files are an important part of community activity and there should have been a better control system for it.
Why is it weird? If an image is not displayed in any posts, why should it exist in the filesystem? Who will view it, and how?
You are right for images but what about js files. We sometimes need to host files at our forum and then link to them from </head> tag
That’d be a very risky use of uploads, since you would be allowing all users to upload javascript files that your site would then execute.
I … can’t … say I would recommend that.
That is right but we upload the js ourselves and have not given rights to anyone else. We disable the js upload as soon as we are done uploading some front-end js files.
Then make sure a hidden staff post links to the files. (There is a private staff category in every install.) And you should be fine.
I have just one new question in mind that is troubling me.
How does Discourse handles illegal hosting done by users using the PM system? What if a user uploads large files via PM and then links to it from an external source. Will cleanup task delete them or not?
Good question! Illegal activity in Messages is another reason admins need visibility into them, cc: @downey.
There is not a way at the moment to browse the largest file uploads but that would be a good thing to have eventually.
I am glad you agreed here. I will be more than pleased to have this option added in future updates ![]()
“Illegal” is going to depend on the jurisdiction. For example, in the United States, the Online Copyright Infringement Liability Limitation Act provides safe harbor for service providers (such as someone running a Discourse site) against actions of their users. As long as the service provider responds to notice of infringing activity, and can produce good records of what that user did or did not do (emphasis hint for @codinghorror), and how they responded to that user and that user’s infringing content, then they are generally not liable for those actions.
In other words, it may not (or may, depending on where you are) be the job of the service provider to police and snoop on its users’ activities.
Sure, Nginx or Apache server logs would exist in all cases for all websites. So you are covered. This is real basic web stuff.
Whether the uploads are illegal or not, the site owner might not appreciate a user who signs up, achieves trust level 1 (necessary to message at all) and then posts 1 GB of files per day in PMs.
Still no such feature? How can I remove uploaded image?
Uploaded files that aren’t used anywhere are automatically removed.
Are you talking about an image that is used somewhere?
This are a good news, thank you. Can I delete 'em manually?
오해의 소지를 없애기 위해 묻습니다. 게시글이 수정되었을 때, 이미지/Dropbox 링크 이미지의 모든 인스턴스 중 유일하게 존재하던 것이 삭제된 경우, 해당 이미지는 어디에도 사용되지 않는 것으로 분류되나요? 현재는 편집 내역을 검토할 때 이미지가 표시되는데, 이는 제가 예상하지 못했던 부분입니다.
이것은 두 가지 다른 개념입니다.
이미지는 업로드되어 데이터베이스에 Upload 기록이 있는 것을 말합니다.
"드롭박스 링크 이미지"는 드롭박스가 클라이언트(브라우저)에 "서빙"하는 이미지에 대한 링크를 의미합니다.
자동화된 정리 작업은 업로드된 이미지에만 적용됩니다. 링크된 이미지는 해당되지 않습니다.
즉, 실제로 게시되지 않았거나 댓글에서 편집되어 제거된 upload 기록이 있는 이미지는 자동으로 삭제됩니다. 맞나요?
edited.png
위 PNG 이미지는 Dropbox 링크에서 가져온 것입니다. 이전에 .gif 파일에 대해 경험한 바로는, 기본 링크를 삭제해도 이미지가 댓글에 그대로 유지되었습니다. 게시물을 편집하여 링크를 제거해도, 게시물의 원래 버전에서는 이미지가 유지되었습니다. 이 게시물은 편집될 예정이므로, 제가 의도한 바를 보여줄 수 있기를 바랍니다!
이것은 "서빙(served)"되는 것 같지 않고, 업로드되는 것처럼 보입니다. 그렇지 않나요?
편집 #2
-
Dropbox 쪽에서 링크를 삭제했고, 즉시 게시물에서 볼 수 없게 되었습니다.
-
링크를 다시 활성화한 후, 대신 게시물을 편집하여 링크를 제거했지만, 다른 브라우저에서는 게시물의 이전 편집 버전을 볼 수 없었습니다(연필 아이콘이 없으므로) - 이를 테스트하기 위해:
게시물을 편집하여 링크를 제거해도, 게시물의 원래 버전에서는 이미지가 유지되었습니다.
1번 항목의 동작은 여기의 게시물과 모순됩니다. 첫 번째 게시물의 편집 이력을 살펴보면 .gif 파일을 볼 수 있습니다. 기본 링크가 작동하지 않고 게시물에도 더 이상 표시되지 않으므로, 여기와 저기의 차이에 대해 혼란스럽습니다.