Change the to first letter of file name lowercase
This commit is contained in:
parent
fc050631e7
commit
882dc50671
@ -513,7 +513,7 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
if (string.IsNullOrEmpty(Image.Base64Data))
|
if (string.IsNullOrEmpty(Image.Base64Data))
|
||||||
return BadRequest(ApiResponse<object>.ErrorResponse("Base64 data is missing", "Base64 data is missing", 400));
|
return BadRequest(ApiResponse<object>.ErrorResponse("Base64 data is missing", "Base64 data is missing", 400));
|
||||||
|
|
||||||
objectKey = await _s3Service.UploadFileAsync(Image.Base64Data, TenantId, "Attendance");
|
objectKey = await _s3Service.UploadFileAsync(Image.Base64Data, TenantId, "attendance");
|
||||||
preSignedUrl = _s3Service.GeneratePreSignedUrlAsync(objectKey);
|
preSignedUrl = _s3Service.GeneratePreSignedUrlAsync(objectKey);
|
||||||
|
|
||||||
document = new Document
|
document = new Document
|
||||||
|
@ -69,7 +69,7 @@ namespace Marco.Pms.Services.Controllers
|
|||||||
return BadRequest(ApiResponse<object>.ErrorResponse("Base64 data is missing", "Base64 data is missing", 400));
|
return BadRequest(ApiResponse<object>.ErrorResponse("Base64 data is missing", "Base64 data is missing", 400));
|
||||||
}
|
}
|
||||||
|
|
||||||
var objectKey = await _s3Service.UploadFileAsync(Image.Base64Data, tenantId, "Forum");
|
var objectKey = await _s3Service.UploadFileAsync(Image.Base64Data, tenantId, "forum");
|
||||||
|
|
||||||
Document document = attachmentDto.ToDocumentFromForumAttachmentDto(objectKey, objectKey, createTicketDto.CreatedAt, tenantId);
|
Document document = attachmentDto.ToDocumentFromForumAttachmentDto(objectKey, objectKey, createTicketDto.CreatedAt, tenantId);
|
||||||
_context.Documents.Add(document);
|
_context.Documents.Add(document);
|
||||||
@ -185,7 +185,7 @@ namespace Marco.Pms.Services.Controllers
|
|||||||
return BadRequest(ApiResponse<object>.ErrorResponse("Base64 data is missing", "Base64 data is missing", 400));
|
return BadRequest(ApiResponse<object>.ErrorResponse("Base64 data is missing", "Base64 data is missing", 400));
|
||||||
}
|
}
|
||||||
|
|
||||||
var objectKey = await _s3Service.UploadFileAsync(Image.Base64Data, tenantId, "Forum");
|
var objectKey = await _s3Service.UploadFileAsync(Image.Base64Data, tenantId, "forum");
|
||||||
|
|
||||||
Document document = attachmentDto.ToDocumentFromUpdateAttachmentDto(objectKey, objectKey, updateTicketDto.CreatedAt, tenantId);
|
Document document = attachmentDto.ToDocumentFromUpdateAttachmentDto(objectKey, objectKey, updateTicketDto.CreatedAt, tenantId);
|
||||||
_context.Documents.Add(document);
|
_context.Documents.Add(document);
|
||||||
@ -343,7 +343,7 @@ namespace Marco.Pms.Services.Controllers
|
|||||||
return BadRequest(ApiResponse<object>.ErrorResponse("Base64 data is missing", "Base64 data is missing", 400));
|
return BadRequest(ApiResponse<object>.ErrorResponse("Base64 data is missing", "Base64 data is missing", 400));
|
||||||
}
|
}
|
||||||
|
|
||||||
var objectKey = await _s3Service.UploadFileAsync(Image.Base64Data, tenantId, "Forum");
|
var objectKey = await _s3Service.UploadFileAsync(Image.Base64Data, tenantId, "forum");
|
||||||
|
|
||||||
Document document = attachmentDto.ToDocumentFromForumAttachmentDto(objectKey, objectKey, addCommentDto.SentAt, tenantId);
|
Document document = attachmentDto.ToDocumentFromForumAttachmentDto(objectKey, objectKey, addCommentDto.SentAt, tenantId);
|
||||||
_context.Documents.Add(document);
|
_context.Documents.Add(document);
|
||||||
@ -418,7 +418,7 @@ namespace Marco.Pms.Services.Controllers
|
|||||||
return BadRequest(ApiResponse<object>.ErrorResponse("Base64 data is missing", "Base64 data is missing", 400));
|
return BadRequest(ApiResponse<object>.ErrorResponse("Base64 data is missing", "Base64 data is missing", 400));
|
||||||
}
|
}
|
||||||
|
|
||||||
var objectKey = await _s3Service.UploadFileAsync(Image.Base64Data, tenantId, "Forum");
|
var objectKey = await _s3Service.UploadFileAsync(Image.Base64Data, tenantId, "forum");
|
||||||
|
|
||||||
Document document = attachmentDto.ToDocumentFromUpdateAttachmentDto(objectKey, objectKey, existingComment.SentAt, tenantId);
|
Document document = attachmentDto.ToDocumentFromUpdateAttachmentDto(objectKey, objectKey, existingComment.SentAt, tenantId);
|
||||||
_context.Documents.Add(document);
|
_context.Documents.Add(document);
|
||||||
@ -500,7 +500,7 @@ namespace Marco.Pms.Services.Controllers
|
|||||||
return BadRequest(ApiResponse<object>.ErrorResponse("Base64 data is missing", "Base64 data is missing", 400));
|
return BadRequest(ApiResponse<object>.ErrorResponse("Base64 data is missing", "Base64 data is missing", 400));
|
||||||
}
|
}
|
||||||
|
|
||||||
var objectKey = await _s3Service.UploadFileAsync(forumAttachmentDto.Base64Data, tenantId, "Forum");
|
var objectKey = await _s3Service.UploadFileAsync(forumAttachmentDto.Base64Data, tenantId, "forum");
|
||||||
|
|
||||||
Document document = forumAttachmentDto.ToDocumentFromForumAttachmentDto(objectKey, objectKey, forumAttachmentDto.SentAt, tenantId);
|
Document document = forumAttachmentDto.ToDocumentFromForumAttachmentDto(objectKey, objectKey, forumAttachmentDto.SentAt, tenantId);
|
||||||
_context.Documents.Add(document);
|
_context.Documents.Add(document);
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
using Marco.Pms.Model.Utilities;
|
|
||||||
using Marco.Pms.Services.Service;
|
using Marco.Pms.Services.Service;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
@ -33,22 +32,22 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
})
|
})
|
||||||
.ToArray();
|
.ToArray();
|
||||||
}
|
}
|
||||||
[HttpPost("upload-image")]
|
//[HttpPost("upload-image")]
|
||||||
public async Task<IActionResult> SendToSThree([FromBody] FileUploadModel Image)
|
//public async Task<IActionResult> SendToSThree([FromBody] FileUploadModel Image)
|
||||||
{
|
//{
|
||||||
if (string.IsNullOrEmpty(Image.Base64Data))
|
// if (string.IsNullOrEmpty(Image.Base64Data))
|
||||||
return BadRequest("Base64 data is missing");
|
// return BadRequest("Base64 data is missing");
|
||||||
var objectKey = await _s3Service.UploadFileAsync(Image.Base64Data, 1, "Forum");
|
// var objectKey = await _s3Service.UploadFileAsync(Image.Base64Data, 1, "Forum");
|
||||||
//var objectKey = await _s3Service.UploadFileAsync(Image.FileName, Image.ContentType);
|
// //var objectKey = await _s3Service.UploadFileAsync(Image.FileName, Image.ContentType);
|
||||||
var preSignedUrl = _s3Service.GeneratePreSignedUrlAsync(objectKey);
|
// var preSignedUrl = _s3Service.GeneratePreSignedUrlAsync(objectKey);
|
||||||
|
|
||||||
return Ok(new
|
// return Ok(new
|
||||||
{
|
// {
|
||||||
objectKey,
|
// objectKey,
|
||||||
url = preSignedUrl
|
// url = preSignedUrl
|
||||||
});
|
// });
|
||||||
|
|
||||||
}
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user