Open Closed

File IActionResult response from JavaScript AJAX API #2110


User avatar
0
moodyan created

Hello,

I am trying to open a PDF in a new tab in our JavaScript UI. I have an endpoint that returns an IActionResult File (an application/pdf). When I try to make a request via the Dynamic JavaScript API Client Proxy, the endpoint itself returns a successful repsonse, but the proxy throws a deserialization exception. I have tried passing through various dataTypes via the ajax call and that doesn't seem to make a difference, the request always seems to try to deserialize the response into JSON, which obviously doesn't work. I have also tried returning an HttpResponseMessage from the endpoint and tried different dataTypes and that also isn't working, I still get a derialization exception. Just wanted to check to see if this is currently supported with the client proxy, and if so, what am I missing?

Thanks!

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share hte endpoint code? Maybe you can use IRemoteStreamContent .

    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 September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.