From fd349ab0c74926ca75ed248a38464fa7611d9580 Mon Sep 17 00:00:00 2001 From: Abhinav Raut Date: Wed, 26 Nov 2025 15:10:37 +0530 Subject: [PATCH] add debug logs while detecting content type --- internal/media/media.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/media/media.go b/internal/media/media.go index 8a7d7018..83c5b152 100644 --- a/internal/media/media.go +++ b/internal/media/media.go @@ -103,6 +103,9 @@ func (m *Manager) UploadAndInsert(srcFilename, contentType, contentID string, mo // Upload saves the media file to the storage backend - returns the generated filename and content type (after detection). func (m *Manager) Upload(fileName, contentType string, content io.ReadSeeker) (string, string, error) { + // On store file is named by UUID to avoid collisions and the actual filename is stored in DB. + m.lo.Debug("detecting content type for file before upload", "uuid", fileName, "source_content_type", contentType) + // Detect content type and override if needed. contentType, err := m.detectContentType(contentType, content) if err != nil {