It looks like the issue is due to how Chromium-based browsers handle direct downloads from link buttons. Modern browsers enforce stricter security policies, which might be affecting the download functionality of your Telerik RadButton.
Hello All,
I'm using a couple of Radbuttons to enable users to download some forms (in Word). This has stopped working in Chromium based browsers for some reason (new Edge, Chrome). It still works in Internet Explorer. No errors in the browser DevTools and no error on the server either.
It also does not work in Cassini (VS2017).
Not sure where to go from here - can anyone confirm/deny?
TIA - Marcus.
code stub:
<telerik:RadButton ButtonType="LinkButton" RenderMode="Lightweight" ID="btnName" runat="server" Text="Button Text" CssClass="TemplBtn" NavigateUrl="~/assets/someform.docx">
<Icon PrimaryIconCssClass="rbDownload" />
</telerik:RadButton>
It looks like the issue is due to how Chromium-based browsers handle direct downloads from link buttons. Modern browsers enforce stricter security policies, which might be affecting the download functionality of your Telerik RadButton.
Use a Direct <a>
Tag with download
Attribute:
Try replacing the RadButton with a simple <a>
tag to check if the issue persists:
html<a href="~/assets/someform.docx" download>Download File</a>
If this works, then the issue is likely with the way RadButton renders links.
Force File Download via Code-Behind:
Instead of linking directly to the file, use a handler (ashx
file) or serve the file in the code-behind to force a download:
protected void btnDownload_Click(object sender, EventArgs e){
string filePath = Server.MapPath("~/assets/someform.docx");
Response.Clear();
Response.ContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
Response.AddHeader("Content-Disposition", "attachment; filename=someform.docx");
Response.WriteFile(filePath);
Response.End();
}
Update your RadButton to trigger this method instead.
Check Browser Console for Security Blocks:
Open DevTools (F12) in Chrome/Edge and check for any security errors related to CORS, Content Security Policy (CSP), or mixed content.
Ensure Correct Content-Type and Headers:
If the file is hosted on an external server, ensure it sends the correct Content-Disposition: attachment
header.
Try Telerik Updates:
If you're using an older Telerik version, updating to the latest version might fix compatibility issues with Chromium-based browsers.
Test in Zoho Developer Environment:
If you're integrating with Zoho Developer, ensure that the file is accessible within the Zoho app and check if any Zoho security settings are preventing downloads.
Hello John,
There seems to be some further Google Chrome updates affecting this issue. We can continue the discussion in the new Feedback portal item:
Regards,
Peter Milchev
Progress Telerik
Running Chrome 84 and 2020.2.617.40 (just downloaded last week).
Issue still there.
I need a linkbutton to open a new window while still performing postback.
Hello Marcus,
The recent version of Chrome v83 came with a bunch of security updates:
https://venturebeat.com/2020/05/19/google-chrome-83/
Apparently, it led to some issue related to requests. Here are some samples:
These changes affect the following RadButton configurations and the navigation action stops working:
<telerik:RadButton … ButtonType="LinkButton"
NavigateUrl="https://www.mysite.com">
</telerik:RadButton>
<telerik:RadButton … ButtonType="SkinnedButton"
NavigateUrl="https://www.mysite.com">
</telerik:RadButton>
Solution:
Option 1:
Use the RadLinkButton instead which is the dedicated way of creating navigation buttons:
https://demos.telerik.com/aspnet-ajax/linkbutton/overview/defaultcs.aspx
Option 2:
Wait for the fix which will be available with the upcoming service pack version 2020 R2 SP1.
Regards,
Eyup
Progress Telerik