Able to access thumbnail

This commit is contained in:
2025-07-30 17:40:12 +08:00
parent e243b0f47a
commit 1e25982c08

View File

@@ -22,6 +22,7 @@ public class FileController(
string id,
[FromQuery] bool download = false,
[FromQuery] bool original = false,
[FromQuery] bool thumbnail = false,
[FromQuery] string? overrideMimeType = null,
[FromQuery] string? passcode = null
)
@@ -64,7 +65,9 @@ public class FileController(
var fileName = string.IsNullOrWhiteSpace(file.StorageId) ? file.Id : file.StorageId;
if (!original && file.HasCompression)
if (thumbnail && file.HasThumbnail)
fileName += ".thumbnail";
else if (!original && file.HasCompression)
fileName += ".compressed";
if (dest.ImageProxy is not null && (file.MimeType?.StartsWith("image/") ?? false))
@@ -88,7 +91,8 @@ public class FileController(
var client = fs.CreateMinioClient(dest);
if (client is null)
return BadRequest(
"Failed to configure client for remote destination, file got an invalid storage remote.");
"Failed to configure client for remote destination, file got an invalid storage remote."
);
var headers = new Dictionary<string, string>();
if (fileExtension is not null)