diff --git a/starsky/starsky/Controllers/UploadController.cs b/starsky/starsky/Controllers/UploadController.cs index 5290421ba..712b4904b 100644 --- a/starsky/starsky/Controllers/UploadController.cs +++ b/starsky/starsky/Controllers/UploadController.cs @@ -89,12 +89,16 @@ public UploadController(IImport import, AppSettings appSettings, public async Task UploadToFolder() { var to = Request.Headers["to"].ToString(); + if ( string.IsNullOrWhiteSpace(to) ) { + _logger.LogInformation($"[UploadToFolder] Missing 'to' header in request"); return BadRequest("missing 'to' header"); } var parentDirectory = GetParentDirectoryFromRequestHeader(); + _logger.LogInformation($"[UploadToFolder] Upload Start to: {parentDirectory}"); + if ( parentDirectory == null ) { return NotFound(new ImportIndexItem { Status = ImportStatus.ParentDirectoryNotFound });