mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
POS and Crowdfund: Improve item editor (#5418)
* POS and Crowdfund: Improve item editor Makes it work the same way as the form editor: Drag and drop for reordering and inline editing without modal. * Upload component
This commit is contained in:
@@ -228,13 +228,17 @@ namespace BTCPayServer.Controllers
|
||||
if (app is null || userId is null)
|
||||
return NotFound();
|
||||
|
||||
if (!file.FileName.IsValidFileName())
|
||||
{
|
||||
return Json(new { error = "Invalid file name" });
|
||||
}
|
||||
if (!file.ContentType.StartsWith("image/", StringComparison.InvariantCulture))
|
||||
{
|
||||
return Json(new { error = "The file needs to be an image" });
|
||||
}
|
||||
if (file.Length > 500_000)
|
||||
{
|
||||
return Json(new { error = "The image file size should be less than 0.5MB" });
|
||||
return Json(new { error = "The file size should be less than 0.5MB" });
|
||||
}
|
||||
var formFile = await file.Bufferize();
|
||||
if (!FileTypeDetector.IsPicture(formFile.Buffer, formFile.FileName))
|
||||
|
||||
Reference in New Issue
Block a user