mirror of
https://github.com/streetwriters/notesnook-sync-server.git
synced 2026-02-12 19:22:45 +00:00
s3: add limit on download file size
This commit is contained in:
committed by
Abdullah Atta
parent
3bb140aeb3
commit
61dd2e1f74
@@ -86,7 +86,7 @@ namespace Notesnook.API.Controllers
|
||||
|
||||
|
||||
[HttpGet("multipart")]
|
||||
public async Task<IActionResult> MultipartUpload([FromQuery] string name, [FromQuery] int parts, [FromQuery] string uploadId)
|
||||
public async Task<IActionResult> MultipartUpload([FromQuery] string name, [FromQuery] int parts, [FromQuery] string? uploadId)
|
||||
{
|
||||
var userId = this.User.FindFirstValue("sub");
|
||||
try
|
||||
@@ -122,12 +122,16 @@ namespace Notesnook.API.Controllers
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult Download([FromQuery] string name)
|
||||
public async Task<IActionResult> Download([FromQuery] string name)
|
||||
{
|
||||
var userId = this.User.FindFirstValue("sub");
|
||||
var url = S3Service.GetDownloadObjectUrl(userId, name);
|
||||
if (url == null) return BadRequest("Could not create signed url.");
|
||||
return Ok(url);
|
||||
try
|
||||
{
|
||||
var userId = this.User.FindFirstValue("sub");
|
||||
var url = await S3Service.GetDownloadObjectUrl(userId, name);
|
||||
if (url == null) return BadRequest("Could not create signed url.");
|
||||
return Ok(url);
|
||||
}
|
||||
catch (Exception ex) { return BadRequest(ex.Message); }
|
||||
}
|
||||
|
||||
[HttpHead]
|
||||
|
||||
Reference in New Issue
Block a user