Open Closed

PDF document is damaged when download from File management module #1574


User avatar
0
thaithiendi created

Hi support team,

When i download file from client like this I have error when open it from local

Please support to me

  • ABP Framework version: v4.2.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular):no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

19 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    hi,

    I will check it out.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Can you use chrome/edge open the pdf file?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    thaithiendi created

    When i open with chrome

    I still use default code in backend

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    I can't reproduce the problem, can you share a project to reproduce? shiwei.liang@volosoft.com

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    thaithiendi created

    Hi,

    Thanks liangshiwei, I sent source code to your email. I am looking forward to hearing from u soon

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    This is a known issue and we have fixed, See https://github.com/abpframework/abp/pull/8253

    You can upgrade to ABP 4.3

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    thaithiendi created

    Hi, I upgraded ABP 4.2.2 to 4.3, and then i cannot start client side

    Please tell me how to fix it

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    Check the migration guides: https://docs.abp.io/en/commercial/latest/migration-guides/v4_3

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    thaithiendi created

    Hi,

    I have aspnet-core and angular folders in the solution and I run "abp update" command in the parent folder of these two folders. And then I have updated according to the migration guides as your suggestion (Angular UI)

    But still error when i build angular project

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    You can use the following methods to quickly fix the problem:

    public class MyRemoteStreamContentOutputFormatter : OutputFormatter
    {
        public MyRemoteStreamContentOutputFormatter()
        {
            SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse("*/*"));
        }
    
        protected override bool CanWriteType(Type type)
        {
            return typeof(IRemoteStreamContent).IsAssignableFrom(type);
        }
    
        public override async Task WriteResponseBodyAsync(OutputFormatterWriteContext context)
        {
            var remoteStream = (IRemoteStreamContent)context.Object;
            using (var stream = remoteStream.GetStream())
            {
                if (stream.CanSeek)
                {
                    stream.Position = 0;
                }
                await stream.CopyToAsync(context.HttpContext.Response.Body);
            }
        }
    }
    
     Configure<MvcOptions>(options =>
    {
        options.OutputFormatters.RemoveType<RemoteStreamContentOutputFormatter>();
        options.OutputFormatters.Insert(0, new MyRemoteStreamContentOutputFormatter());
    });
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    thaithiendi created

    Hi,

    I just built angular project.I haven't build backend yet. Error show in client side when i run "ng serve --o"

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Mehmet created

    Hi @thaithiendi

    Please try to remove the node_modules folder and install the packages with the yarn command.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    thaithiendi created

    Thanks Mehmet,

    I remove node_modules and reinstall, Angluar project built ok, but menu FileManagement is not displayed anymore.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Mehmet created

    Go to the http://localhost:4200/file-management URL manually, what do you see?

    If you see the 403 error page, please check the user's permission. If you see the 404 error page, please share app.module.ts and app-routing.module.ts files content so that I can find source of the problem.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    thaithiendi created

    Hi,

    I see the 403 error, how to check user's permission. I cannot see menu to assign to user.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    File management is a feature, you can see the in the saas page.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    thaithiendi created

    Hi, I can see Enable File management in Saas feature , But i don't see menu File managerment (i re-login).

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    Can I check it remotely? shiwei.liang@volosoft.com

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    ServiceBot created
    Support Team Automatic process manager

    This question has been automatically marked as stale because it has not had recent activity.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on October 05, 2026, 11:32
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.