This is a migrated thread and some comments may be shown as answers.

Ajex Issue in File Download

7 Answers 134 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
test
Top achievements
Rank 1
test asked on 18 Sep 2009, 12:11 AM

I got the message "to help protect your security, Internet Explorer blocked this site from downloading.." from the browser when implementing Ajax download (progress image),

my client code is like:
<
telerik:RadAjaxPanel ID="RadAjaxPanel3" runat="server" LoadingPanelID="LoadingPanel1"> My Download button here...

 

</telerik:RadAjaxPanel>

My server side code 

if (GetPDF() == true)

 

Response.Redirect("PDFDownload.aspx");   

.....
If I remove RadAjaxPanel, it works fine (no borwser message)
Your help is appreciated.

Thanks
Wei

7 Answers, 1 is accepted

Sort by
0
Stuart Hemming
Top achievements
Rank 2
answered on 18 Sep 2009, 08:52 AM

Wei,

Have a look at this online help article. It explains that you can't use Upload and Ajax together and how tio work around it.

--

Stuart
If this answers you question, don't forget to press the "Mark as Answer" link.

0
test
Top achievements
Rank 1
answered on 18 Sep 2009, 11:00 AM
well, this article talks about Uploading, but my issue is Download. I used Ajax Uploading, it works fine for me. But download is different...In my code, I redirect to another simple page (without AJAX) to do the download, but it caused the security message from the browser.
Your another article suggests using ResponseScripts, so I changed my code to

RadAjaxPanel1.ResponseScripts.Add(

"window.location.href = ""PDFDownload.aspx"";")

I still got the "download blocked" message.
Your help is appreciated.
Thanks
Wei

 

0
Stuart Hemming
Top achievements
Rank 2
answered on 18 Sep 2009, 11:44 AM
Sorry, I guess I shouldn't try to be clever so early in the morning! :-)

--
Stuart
0
Martin
Telerik team
answered on 18 Sep 2009, 03:20 PM
Hello Wei,

Please review this forum thread discussing similar scenario.
In addition I am attaching a sample website that uses redirection to a download page that runs as expected on my end.

I hope this helps.

Regards,
Martin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
test
Top achievements
Rank 1
answered on 18 Sep 2009, 03:43 PM
Thanks for your response.
I looked at your attachment. It is different from my case. In my case click the button will go to the server, and the server may spend 5 mins to process it. Once done at the server end, I want another page (without Ajax) to do the download. I tried 

Response.redirct("PDFDownload.aspx")
and

ScriptManager.RegisterStartupScript(

Me.Page, Me.Page.GetType(), "script", "DownloadPdf()", True)

 


RadAjaxPanel1.ResponseScripts.Add("window.open(""PDFDownload.aspx"")")
and
RadAjaxPanel1.ResponseScripts.Add("window.location.href = ""PDFDownload.aspx"";")


Nothing works for me. If I remove <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="LoadingPanel1">, things back to work.
This should be the issue commonly seen. I really appreciate if you can talk among your team, and give me a solution

Thanks
Wei

 

0
test
Top achievements
Rank 1
answered on 19 Sep 2009, 04:05 PM
Very interesting, when I tried to download the latest teleric AJAX .NET code, I got the exact same message:  " to protect your security, the Internet explorer blocked this side from downloading file..."
0
Martin
Telerik team
answered on 23 Sep 2009, 08:42 AM
Hello Wei,

This is Internet Explorer specific behaviour that you can learn more about here. Let me know if using any other supported browser (Firefox for example) brings you the same message.
I also modified the sample project so now it uses server redirection to the page where the download is performed.

I hope this helps

Regards,
Martin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Ajax
Asked by
test
Top achievements
Rank 1
Answers by
Stuart Hemming
Top achievements
Rank 2
test
Top achievements
Rank 1
Martin
Telerik team
Share this question
or