✨ Able to access thumbnail
This commit is contained in:
@@ -22,6 +22,7 @@ public class FileController(
|
|||||||
string id,
|
string id,
|
||||||
[FromQuery] bool download = false,
|
[FromQuery] bool download = false,
|
||||||
[FromQuery] bool original = false,
|
[FromQuery] bool original = false,
|
||||||
|
[FromQuery] bool thumbnail = false,
|
||||||
[FromQuery] string? overrideMimeType = null,
|
[FromQuery] string? overrideMimeType = null,
|
||||||
[FromQuery] string? passcode = null
|
[FromQuery] string? passcode = null
|
||||||
)
|
)
|
||||||
@@ -64,7 +65,9 @@ public class FileController(
|
|||||||
|
|
||||||
var fileName = string.IsNullOrWhiteSpace(file.StorageId) ? file.Id : file.StorageId;
|
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";
|
fileName += ".compressed";
|
||||||
|
|
||||||
if (dest.ImageProxy is not null && (file.MimeType?.StartsWith("image/") ?? false))
|
if (dest.ImageProxy is not null && (file.MimeType?.StartsWith("image/") ?? false))
|
||||||
@@ -88,7 +91,8 @@ public class FileController(
|
|||||||
var client = fs.CreateMinioClient(dest);
|
var client = fs.CreateMinioClient(dest);
|
||||||
if (client is null)
|
if (client is null)
|
||||||
return BadRequest(
|
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>();
|
var headers = new Dictionary<string, string>();
|
||||||
if (fileExtension is not null)
|
if (fileExtension is not null)
|
||||||
|
Reference in New Issue
Block a user