|
|
@ -39,16 +39,17 @@ namespace Tiobon.Core.Services |
|
|
|
|
|
|
|
|
|
|
|
if (upload.chunkIndex == upload.totalChunks - 1) |
|
|
|
if (upload.chunkIndex == upload.totalChunks - 1) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var id = SnowFlakeSingle.Instance.NextId(); |
|
|
|
|
|
|
|
await FileMerge(upload.id, ".mp4", id); |
|
|
|
|
|
|
|
using var _context = ContextFactory.CreateContext(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ext = string.Empty; |
|
|
|
var ext = string.Empty; |
|
|
|
if (string.IsNullOrEmpty(file.FileName) == false) |
|
|
|
if (string.IsNullOrEmpty(file.FileName) == false) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var dotPos = upload.fileName.LastIndexOf('.'); |
|
|
|
var dotPos = upload.fileName.LastIndexOf('.'); |
|
|
|
ext = upload.fileName.Substring(dotPos + 1); |
|
|
|
ext = upload.fileName.Substring(dotPos + 1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var id = SnowFlakeSingle.Instance.NextId(); |
|
|
|
|
|
|
|
await FileMerge(upload.id, "."+ ext, id); |
|
|
|
|
|
|
|
using var _context = ContextFactory.CreateContext(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var filePath = $"/files/upload/{id}.{ext}"; |
|
|
|
var filePath = $"/files/upload/{id}.{ext}"; |
|
|
|
var fileAttachment = new Ghre_Attachment(); |
|
|
|
var fileAttachment = new Ghre_Attachment(); |
|
|
|
fileAttachment.Id = SnowFlakeSingle.Instance.NextId(); |
|
|
|
fileAttachment.Id = SnowFlakeSingle.Instance.NextId(); |
|
|
@ -74,10 +75,10 @@ namespace Tiobon.Core.Services |
|
|
|
AttachFileName = fileAttachment.AttachFileName, |
|
|
|
AttachFileName = fileAttachment.AttachFileName, |
|
|
|
AttachmentName = fileAttachment.AttachmentName, |
|
|
|
AttachmentName = fileAttachment.AttachmentName, |
|
|
|
AttachmentNo = fileAttachment.AttachmentNo, |
|
|
|
AttachmentNo = fileAttachment.AttachmentNo, |
|
|
|
FileURL = fileAttachment.FileURL, |
|
|
|
FileURL = "/Advanced" + fileAttachment.FileURL, |
|
|
|
PhysicsPath = fileAttachment.PhysicsPath, |
|
|
|
PhysicsPath = "/Advanced" + fileAttachment.PhysicsPath, |
|
|
|
RelativePath = fileAttachment.RelativePath, |
|
|
|
RelativePath = "/Advanced" + fileAttachment.RelativePath, |
|
|
|
ThumbnailPath = fileAttachment.ThumbnailPath, |
|
|
|
ThumbnailPath = "/Advanced" + fileAttachment.ThumbnailPath, |
|
|
|
AttachFileSize = fileAttachment.AttachFileSize, |
|
|
|
AttachFileSize = fileAttachment.AttachFileSize, |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|