Web api download file example - rather good
Web api download file example - not
Download file using Web API[Answered] RSS
Hi romah,
romah
Above code works fine in my development machine (downloads all files in all browsers) but I am getting following error while deploying in server.
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Message>An error has occurred.</Message>
</Error>
Please help.
According to your description, we couldn't directly find the reason why you faced this error.
Could you please post more details error message?
I found you have enable the custom error in your web config, so we couldn't get details error message.
I suggest you could modify the web.config file on the server as below:
<system.web> <customErrors mode="Off" /> <compilation debug="true" targetFramework="4.6.1" /> <httpRuntime targetFramework="4.6.1" /> <httpModules> <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" /> </httpModules> </system.web>You could use browser F12 develop tool's network tag to see the details response from the web api.
Besides, if you don't use browser, I suggest you could use postman to send the request and see the details error message.
Best Regards,
Brando

-
-
-