Open Closed

File Management file download exception #3563


User avatar
0
lizhaofeng created
  • ABP Framework version: v5.3.3
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

There is an exception when downloading attachments with Chinese characters using File Management. The exception still exists when debugging with Swagger. The following is the error message:

2022-08-13 18:23:56.657 +08:00 [INF] Request starting HTTP/1.1 GET http://192.168.235.128:44378/api/file-management/file-descriptor/download/884f5de3-c63f-8092-f51f-3a05a8e817fb/token?api-version=1.0 - - 2022-08-13 18:23:56.661 +08:00 [DBG] PermissionStore.GetCacheItemAsync: pn:U,pk:7fb2f2f3-b8f9-9ebc-0192-3a05169b039b,n:FileManagement.FileDescriptor 2022-08-13 18:23:56.663 +08:00 [DBG] Found in the cache: pn:U,pk:7fb2f2f3-b8f9-9ebc-0192-3a05169b039b,n:FileManagement.FileDescriptor 2022-08-13 18:23:56.663 +08:00 [DBG] PermissionStore.GetCacheItemAsync: pn:R,pk:admin,n:FileManagement.FileDescriptor 2022-08-13 18:23:56.664 +08:00 [DBG] Found in the cache: pn:R,pk:admin,n:FileManagement.FileDescriptor 2022-08-13 18:23:56.664 +08:00 [DBG] PermissionStore.GetCacheItemAsync: pn:C,pk:BookStore_BlazorServerTiered,n:FileManagement.FileDescriptor 2022-08-13 18:23:56.666 +08:00 [DBG] Found in the cache: pn:C,pk:BookStore_BlazorServerTiered,n:FileManagement.FileDescriptor 2022-08-13 18:23:56.667 +08:00 [INF] Executing endpoint 'Volo.FileManagement.Files.FileDescriptorController.GetDownloadTokenAsync (Volo.FileManagement.HttpApi)' 2022-08-13 18:23:56.673 +08:00 [INF] Route matched with {controller = "FileDescriptors", area = "fileManagement", action = "GetDownloadToken", page = ""}. Executing controller action with signature System.Threading.Tasks.Task1[Volo.FileManagement.Files.DownloadTokenResultDto] GetDownloadTokenAsync(System.Guid) on controller Volo.FileManagement.Files.FileDescriptorController (Volo.FileManagement.HttpApi). 2022-08-13 18:23:56.689 +08:00 [DBG] PermissionStore.GetCacheItemAsync: pn:U,pk:7fb2f2f3-b8f9-9ebc-0192-3a05169b039b,n:FileManagement.FileDescriptor 2022-08-13 18:23:56.691 +08:00 [DBG] Found in the cache: pn:U,pk:7fb2f2f3-b8f9-9ebc-0192-3a05169b039b,n:FileManagement.FileDescriptor 2022-08-13 18:23:56.691 +08:00 [DBG] PermissionStore.GetCacheItemAsync: pn:R,pk:admin,n:FileManagement.FileDescriptor 2022-08-13 18:23:56.693 +08:00 [DBG] Found in the cache: pn:R,pk:admin,n:FileManagement.FileDescriptor 2022-08-13 18:23:56.693 +08:00 [DBG] PermissionStore.GetCacheItemAsync: pn:C,pk:BookStore_BlazorServerTiered,n:FileManagement.FileDescriptor 2022-08-13 18:23:56.694 +08:00 [DBG] Found in the cache: pn:C,pk:BookStore_BlazorServerTiered,n:FileManagement.FileDescriptor 2022-08-13 18:23:56.717 +08:00 [INF] Executing ObjectResult, writing value of type 'Volo.FileManagement.Files.DownloadTokenResultDto'. 2022-08-13 18:23:56.718 +08:00 [INF] Executed action Volo.FileManagement.Files.FileDescriptorController.GetDownloadTokenAsync (Volo.FileManagement.HttpApi) in 45.7411ms 2022-08-13 18:23:56.718 +08:00 [INF] Executed endpoint 'Volo.FileManagement.Files.FileDescriptorController.GetDownloadTokenAsync (Volo.FileManagement.HttpApi)' 2022-08-13 18:23:56.719 +08:00 [INF] Request finished HTTP/1.1 GET http://192.168.235.128:44378/api/file-management/file-descriptor/download/884f5de3-c63f-8092-f51f-3a05a8e817fb/token?api-version=1.0 - - - 200 - application/json;+charset=utf-8 61.9902ms 2022-08-13 18:23:56.764 +08:00 [INF] Request starting HTTP/1.1 GET http://192.168.235.128:44378/api/file-management/file-descriptor/download/884f5de3-c63f-8092-f51f-3a05a8e817fb?token=9f3a8d32-ae2a-4193-8102-408280b92a57&api-version=1.0 - - 2022-08-13 18:23:56.768 +08:00 [INF] Executing endpoint 'Volo.FileManagement.Files.FileDescriptorController.DownloadAsync (Volo.FileManagement.HttpApi)' 2022-08-13 18:23:56.773 +08:00 [INF] Route matched with {controller = "FileDescriptors", area = "fileManagement", action = "Download", page = ""}. Executing controller action with signature System.Threading.Tasks.Task1[Volo.Abp.Content.IRemoteStreamContent] DownloadAsync(System.Guid, System.String) on controller Volo.FileManagement.Files.FileDescriptorController (Volo.FileManagement.HttpApi). 2022-08-13 18:23:56.835 +08:00 [ERR] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "对不起,在处理你的请求期间,产生了一个服务器内部错误!", "details": null, "data": {}, "validationErrors": null }

2022-08-13 18:23:56.836 +08:00 [ERR] Invalid non-ASCII or control character in header: 0x6570 System.InvalidOperationException: Invalid non-ASCII or control character in header: 0x6570 at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpHeaders.ThrowInvalidHeaderCharacter(Char ch) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpHeaders.ValidateHeaderValueCharacters(String headerName, StringValues headerValues, Func2 encodingSelector) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpResponseHeaders.AddValueFast(String key, StringValues value) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpHeaders.System.Collections.Generic.IDictionary<System.String,Microsoft.Extensions.Primitives.StringValues>.Add(String key, StringValues value) at Volo.FileManagement.Files.FileDescriptorController.DownloadAsync(Guid id, String token) at lambda_method3210(Closure , Object ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) 2022-08-13 18:23:56.848 +08:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.Http.RemoteServiceErrorResponse'. 2022-08-13 18:23:56.850 +08:00 [INF] Executed action Volo.FileManagement.Files.FileDescriptorController.DownloadAsync (Volo.FileManagement.HttpApi) in 76.1619ms 2022-08-13 18:23:56.850 +08:00 [INF] Executed endpoint 'Volo.FileManagement.Files.FileDescriptorController.DownloadAsync (Volo.FileManagement.HttpApi)'


1 Answer(s)
  • User Avatar
    0
    berkansasmaz created
    Support Team .NET Developer

    Thanks for reporting the issue. I'm opening an internal issue on the subject.

    Please let us know if you need a workaround solution.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11