|
|
@ -109,9 +109,9 @@ public class FileController : BaseApiController |
|
|
|
string pathHeader = "wwwroot/files/" + filePath; |
|
|
|
string pathHeader = "wwwroot/files/" + filePath; |
|
|
|
if (!Directory.Exists(pathHeader)) |
|
|
|
if (!Directory.Exists(pathHeader)) |
|
|
|
Directory.CreateDirectory(pathHeader); |
|
|
|
Directory.CreateDirectory(pathHeader); |
|
|
|
long fileName = SnowFlakeSingle.instance.getID(); |
|
|
|
var fileName = upload.fileName.Replace("." + ext, "_") + DateTime.Now.ToString("yyyyMMddHHmmss"); |
|
|
|
|
|
|
|
|
|
|
|
filePath = "/files/" + filePath + "/" + $"{upload.fileName}_{fileName}.{ext}"; |
|
|
|
filePath = "/files/" + filePath + "/" + $"{fileName}.{ext}"; |
|
|
|
//var filepath = Path.Combine(pathHeader, file.FileName); |
|
|
|
//var filepath = Path.Combine(pathHeader, file.FileName); |
|
|
|
using (var stream = global::System.IO.File.Create("wwwroot/" + filePath)) |
|
|
|
using (var stream = global::System.IO.File.Create("wwwroot/" + filePath)) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -123,7 +123,7 @@ public class FileController : BaseApiController |
|
|
|
fileAttachment.AttachFileName = upload.file.FileName; |
|
|
|
fileAttachment.AttachFileName = upload.file.FileName; |
|
|
|
fileAttachment.CreateBy = App.User.ID; |
|
|
|
fileAttachment.CreateBy = App.User.ID; |
|
|
|
fileAttachment.CreateTime = DateTime.Now; |
|
|
|
fileAttachment.CreateTime = DateTime.Now; |
|
|
|
fileAttachment.AttachmentName = fileName.ToString(); |
|
|
|
fileAttachment.AttachmentName = fileName; |
|
|
|
fileAttachment.AttachFileExtension = ext; |
|
|
|
fileAttachment.AttachFileExtension = ext; |
|
|
|
fileAttachment.AttachFileSize = upload.file.Length; |
|
|
|
fileAttachment.AttachFileSize = upload.file.Length; |
|
|
|
fileAttachment.PhysicsPath = filePath; |
|
|
|
fileAttachment.PhysicsPath = filePath; |
|
|
@ -139,7 +139,7 @@ public class FileController : BaseApiController |
|
|
|
Id = fileAttachment.Id, |
|
|
|
Id = fileAttachment.Id, |
|
|
|
AttachFileExtension = fileAttachment.AttachFileExtension, |
|
|
|
AttachFileExtension = fileAttachment.AttachFileExtension, |
|
|
|
AttachFileName = fileAttachment.AttachFileName, |
|
|
|
AttachFileName = fileAttachment.AttachFileName, |
|
|
|
AttachmentName = fileAttachment.AttachmentName, |
|
|
|
AttachmentName = fileName, |
|
|
|
AttachmentNo = fileAttachment.AttachmentNo, |
|
|
|
AttachmentNo = fileAttachment.AttachmentNo, |
|
|
|
FileURL = fileAttachment.FileURL, |
|
|
|
FileURL = fileAttachment.FileURL, |
|
|
|
PhysicsPath = fileAttachment.PhysicsPath, |
|
|
|
PhysicsPath = fileAttachment.PhysicsPath, |
|
|
|