Server Method - Show PDF - Error 404

Hi,

I am able to show a pdf in the browser while debugging and when published to azure.

When I publish to iis I get an error 404.

Here is the code:

public IActionResult AnzeigenVollmacht([FromQuery] string Kommnr)
{
// dokument finden
var dokument = contextDok.VollmachtEndkundeDokuments.Where(x => x.VermittlerEndkunde.Kommissionsnummer == Kommnr).FirstOrDefault();

        if(dokument != null)
        {
            return File(dokument.Dokument, "application/pdf");
        }



        return null;
    }

Thanks.

Hi @MarkusW,

I am afraid this doesn't seem related to Radzen. If it works in development and Azure then your IIS configuration is somehow preventing the app from working. Unfortunately we don't know what could be causing this.

Hi,

no I now why it is not working.

on IIS it calls:
Ip/api/servermethods/method

But it should call:
IP/applicationname/api/servermethods/method

In the path in my link I added:
applicationname/api
But when i click it I get
applicationname/applicationname/api

Where can I change this? Thanks.

I am afraid I don't understand much of your last post. Please check the forum FAQ for tips how to improve your question.

Hi,

ok. I try to explain it again.

I use the link component to open the pdf file:

I use the path:
/api/servermethods/...

Published to the iis server it calls:
/api/servermethods....

But it should call:
applicationname/api/servermethods...

So I tried to add the application name in the path:
applicationname/api/servermethods...

published to the iis server it calls:
applicationname/applicationname/api/servermethods...

But I do not know why? Thanks.

Putting / in the url means that it is root-ed. Try without / - api/servermethods/....