🐛 Trying to fix upload offset not found in frontend

This commit is contained in:
2025-07-27 14:25:45 +08:00
parent f74b1cf46a
commit 4a0117906a
8 changed files with 35 additions and 13 deletions

View File

@@ -228,6 +228,9 @@ public abstract class TusService
},
OnCreateCompleteAsync = eventContext =>
{
var directUpload = eventContext.HttpContext.Request.Headers["X-DirectUpload"].FirstOrDefault();
if (!string.IsNullOrEmpty(directUpload)) return Task.CompletedTask;
var gatewayUrl = configuration["GatewayUrl"];
if (gatewayUrl is not null)
eventContext.SetUploadUrl(new Uri(gatewayUrl + "/drive/tus/" + eventContext.FileId));