List of all uploaded files

Hello friends,

what are you thinking about some extra tab at the admin interface to keep control over the current disk usage, files sizes, click rates, filtering them after extension and searching for specific terms?

I wish, I could get more control over all attachments.

Best

「いいね!」 7

That’s something I definitely want done. Not sure when though.

「いいね!」 11

Sounds useful!

There is a bunch of product questions around how this could/should work in my mind. It looks like a problem that has been already figured out or solved in other forum software, but I wonder how will this be framed / built around Discourse’s philosophy.

I am also wondering more about the manifestations of providing uploads settings, e.g.: if you chose to introduce extension configuration, the composer needs to cater for this when users are selecting/uploading attachments, and so on. Also, whether this should be in core, or as a plugin.

On the bright side, if we ignore all questions / assumptions / product / design considerations, it doesn’t look like it is technically tricky, I made a one hour spike here (this is very immature implementation though :blush:).

You can definitely extend this with a bunch of useful features: settings, search / filtering, sorting, etc (and some other considerations like supporting pagination, …)

「いいね!」 6

If youbtalking about admin tools. You can considure usong plugin data explorer whic allows admins to query database. When I hunting free space I am querying db there is table uploads whic gives you size location and other useful things. Also one good thing is that deleating rows from uploads also dealeting files. Becouse ther is sidekiq job pruge oprhan uploads.

I am totally open to adding something here, but I feel a top level tab is a bit too much .

Conceptually this feels like a “report” to me with a drilldown vs a section for uploading things.

I would like to see this link to the new report

When I think about this problem I think the main use case is around admins trying to get a handle on the … upload problem…

  • Why do I have so many uploads?

  • Which users have the most/largest uploads ?

  • What are the 100 biggest uploads on my forum?

  • How many things were uploaded in the last month? That way I can keep track of trends.

@codinghorror / @j.jaffeux what are your thoughts here?

「いいね!」 12

Yes I agree it could be a report, we might have to start working on the filtering logic I talked with you months ago. But other than that it should be good.

「いいね!」 3

Great line of questioning @sam !

I think perhaps I lack some context on what is the admin’s job / use case for the upload problem, but it appears to be (if there is any research or perhaps admin opinions to confirm that, it would be great!) that it can be framed as: I am an Admin, I want to gain understanding of my instance’s uploads usage.

I wonder if there are any after actions when the job / use case is satisfied. For example, if the admin notices a problem or a trend, will the admin/site_settings/category/files is the place they can optimise their file uploading strategy?

Also, I agree that the Uploads section is heavy as a top level tab for this use case.

Any news about this topic?

Im looking for a option to look through the uploaded files.

「いいね!」 3

I guess, sorting and listing files isn’t as much as important for Discourse as for us. :see_no_evil:

Similar issue:

ポストのアップロードに関する詳細を取得するための、いくつかのデータエクスプローラークエリをご紹介します。Data Explorer プラグインがインストールされていないサイト向けに、管理レポートセクションに同様の機能を追加できるかもしれません。このデータが求めるものではない場合は、お知らせください。

どのユーザーが最も多く/最も大きなアップロードを持っていますか?

ユーザー、そのアップロード数、および合計アップロードサイズ(KB、小数点以下 2 桁に丸め)を返します。users テーブルとの結合により、削除されたユーザーのデータが返されないようにしています。結果は合計アップロードサイズの降順でソートされます。

最適化された画像を含む場合

WITH uploads_with_optimized AS (
SELECT
ul.user_id,
ROUND((SUM(COALESCE(oi.filesize, 0)) + SUM(ul.filesize)) / 1000.0, 2) AS total_kb
FROM post_uploads pul
JOIN uploads ul
ON ul.id = pul.upload_id
LEFT JOIN optimized_images oi
ON ul.id = oi.upload_id
GROUP BY ul.user_id
)

SELECT
uwo.user_id,
COUNT(uploads.user_id) AS upload_count,
total_kb
FROM uploads_with_optimized uwo
JOIN uploads
ON uploads.user_id = uwo.user_id
GROUP BY uploads.user_id, uwo.user_id, total_kb
ORDER BY total_kb DESC
LIMIT 50

最適化された画像を除外する場合

SELECT
ul.user_id,
COUNT(ul.user_id) AS upload_count,
ROUND(SUM(ul.filesize) / 1000.0, 2) AS total_kb
FROM post_uploads pul
JOIN uploads ul
ON ul.id = pul.upload_id
GROUP BY ul.user_id
ORDER BY total_kb DESC
LIMIT 50

フォーラム上の最大のアップロード 100 件は?

ユーザー、アップロードを含む投稿、およびアップロードのファイルサイズ(KB)を返します。結果はアップロードサイズの降順でソートされます。

最適化された画像を含む場合

SELECT
ul.user_id,
pul.post_id,
ROUND((SUM(oi.filesize) + ul.filesize) / 1000.0, 2) AS total_kb
FROM post_uploads pul
JOIN uploads ul
ON ul.id = pul.upload_id
JOIN optimized_images oi
ON ul.id = oi.upload_id
GROUP BY oi.upload_id, ul.user_id, pul.post_id, ul.filesize
ORDER BY total_kb DESC
LIMIT 100

最適化された画像を除外する場合

SELECT
ul.user_id,
pul.post_id,
ROUND(ul.filesize / 1000.0, 2) AS total_kb
FROM post_uploads pul
JOIN uploads ul
ON ul.id = pul.upload_id
ORDER BY total_kb DESC
LIMIT 100

過去 30 日間のアップロード

このクエリでは :end_date パラメータを指定する必要があります。日付は「yyyy-mm-dd」形式(例:‘2020-01-08’)で入力してください。これは、end_date で終わる 30 日間の期間の結果を返します。ポストアップロードがある日の日付、アップロード数、およびその日の合計アップロードサイズ(KB)を返します。結果は日付順にソートされます。

最適化された画像を含む場合

--[params]
-- date :end_date

SELECT
ul.created_at::date AS day,
COUNT(1) AS upload_count,
ROUND((SUM(COALESCE(oi.filesize, 0)) + SUM(ul.filesize)) / 1000.0, 2) AS total_kb
FROM post_uploads pul
JOIN uploads ul
ON ul.id = pul.upload_id
LEFT JOIN optimized_images oi
ON ul.id = oi.upload_id
WHERE ul.created_at::date BETWEEN :end_date::date - INTERVAL '30 days' AND :end_date
GROUP BY ul.created_at::date
ORDER BY ul.created_at::date DESC

最適化された画像を除外する場合

--[params]
-- date :end_date

SELECT
ul.created_at::date AS day,
COUNT(1) AS upload_count,
ROUND(SUM(ul.filesize) / 1000.0, 2) AS daily_upload_kb
FROM post_uploads pul
JOIN uploads ul
ON ul.id = pul.upload_id
WHERE ul.created_at::date BETWEEN :end_date::date - INTERVAL '30 days' AND :end_date
GROUP BY ul.created_at::date
ORDER BY ul.created_at::date DESC

「いいね!」 11

私は新しい(メタ)コミュニティのメンバーで、最近、Discourse(Discourse によってホストされている)を使用する別のコミュニティの管理者業務を引き継ぎました。ダッシュボードで、アップロードが使用する容量に「急増」があることに気づきました(約 0.7GB から 1.2GB へ)。データエクスプローラーはビジネスプラン以上でのみ利用可能のようですが、追加の 0.5GB を使用している最近のファイルを特定する他の方法はあるでしょうか?

「いいね!」 2

これは完全に私のせいです。

以前、すべてのアップロードのサイズを正しくカウントしていないという大きなバグがありました。

ユーザーが画像をアップロードすると、さまざまな解像度や最適化のために、その画像は 3〜4 回リサイズされることがよくあります。これらの最適化された画像はクラウドに保存され、ストレージ容量を消費し続けます。

実際の画像を確認するには、以下を実行してください。

SELECT * FROM optimized_images

@simon 上記を optimized_images を考慮するように更新していただけませんか?

「いいね!」 5

ああ、なるほどです。私も一瞬、その可能性があったかと考えました——ここに投稿を書いた後ですけどね ;)。

うーん、ダッシュボードのストレージゲージに、その旨を簡潔に一言追加するのは価値があるかもしれません。そうすれば、不明なデータによって誰かがストレージスペースを奪っているのではないかと人々が心配する必要がなくなりますね :wink:

また、もし「アップロードインスペクター」を作成される機会があれば、Business プランのプラグインが不要なものにしていただけると大変助かります!!

ありがとうございます!

「いいね!」 4

ついに、異なるトピックや投稿においてメンバーのアップロード一覧をどうやって確認すればよいのかがわかりませんでした!!??

「いいね!」 1

アップロードされたファイルのディレクトリを閲覧したいと考えています。特に、以下のリンク切れとなった URL の詳細を確認したいと考えています。

もし管理者サポートによりこれを解釈して対応いただければ、大変助かります。あるいは何か見落としているでしょうか?

よろしくお願いいたします、
R

「いいね!」 1

別の回避策は次のとおりです。

  • 「アップロードを含める」でサイトバックアップを作成してダウンロードします。
  • そのアーカイブに移動し、コマンドラインなどから解凍します。$ tar -xvzf xxxx.tar.gz
  • アップロードディレクトリに切り替えます。$ cd uploads
  • 元のセクションと最適化されたセクションの間で選択し、結果のファイルツリーを調べます。
  • アップロード名は存在せず、すべての名前がランダム(またはエンコードされた)文字列を展開します。

管理ポータルにGUIインターフェイスがあれば、より良いUXが提供されます。したがって、私の投票はその機能に賛成です。 R

「いいね!」 1