mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 14:04:26 +01:00
Support temporary links for local file system provider (#848)
* wip * Support temporary links for local file system provider * pass base url to file services * fix test * do not crash on errors with local filesystem * remove console * fix paranthesis
This commit is contained in:
committed by
Nicolas Dorier
parent
25b08b21fa
commit
d86cc9192e
@@ -27,7 +27,7 @@ namespace BTCPayServer.Controllers
|
||||
public async Task<IActionResult> Files(string fileId = null, string statusMessage = null)
|
||||
{
|
||||
TempData["StatusMessage"] = statusMessage;
|
||||
var fileUrl = string.IsNullOrEmpty(fileId) ? null : await _FileService.GetFileUrl(fileId);
|
||||
var fileUrl = string.IsNullOrEmpty(fileId) ? null : await _FileService.GetFileUrl(Request.GetAbsoluteRootUri(), fileId);
|
||||
|
||||
return View(new ViewFilesViewModel()
|
||||
{
|
||||
@@ -116,12 +116,13 @@ namespace BTCPayServer.Controllers
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
var url = await _FileService.GetTemporaryFileUrl(fileId, expiry, viewModel.IsDownload);
|
||||
var url = await _FileService.GetTemporaryFileUrl(Request.GetAbsoluteRootUri(), fileId, expiry, viewModel.IsDownload);
|
||||
|
||||
return RedirectToAction(nameof(Files), new
|
||||
{
|
||||
StatusMessage = new StatusMessageModel()
|
||||
{
|
||||
Severity = StatusMessageModel.StatusSeverity.Success,
|
||||
Html =
|
||||
$"Generated Temporary Url for file {file.FileName} which expires at {expiry.ToBrowserDate()}. <a href='{url}' target='_blank'>{url}</a>"
|
||||
}.ToString(),
|
||||
|
||||
Reference in New Issue
Block a user