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

Major problem with downloads in RadGrid

4 Answers 32 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Boris
Top achievements
Rank 1
Boris asked on 17 Apr 2015, 06:52 PM

Sorry to sound impatient (I may yet have to open a support ticket) but I've been testing my application and I've run into a last minute IE11 compatibility problem.

 I have a RadGrid that uses RadButtons as link buttons to download attached files from a database.  This general set up has been in production for years now and has generally worked perfectly, in Chrome and Firefox.  Unfortunately we've had a number of problems with IE and we had believed we had solved most of them by moving to a new server and this generally seems to be true, with one exception.

I cannot download files in IE.  I get an error message saying file cannot be downloaded.  If I retry it claims to have succeeded but what I get is a corrupted stub of a file.  

The download process itself runs through the RadGrid's ItemCommand event handler and is so far as I know fairly conventional.  I get the file as a string from the database, set the Current.Response.ContentType to whatever the file is (In this case "image/jepg"), then do an add header ( AddHeader("Content-Disposition", "attachment; filename=\"" + sAttachName + "\"") ) and finally a BinaryWrite of the byte array containing the file.   As I said, this works perfectly in Chrome and Firefox.

It occurs to me that I've already had a problem like this earlier (http://www.telerik.com/forums/failure-of-download-links-after-ajaxifying-radgrid) and the code mentioned in that entry has not been changed in any way.

Suggestions?

4 Answers, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 22 Apr 2015, 09:43 AM
Hello Boris,

If there are no JavaScript errors present on the page and the code that disables the AJAX when you click on those links is working correctly in IE 11, there is a very little chance that the problem is related to our controls in any way. Having that in mind, please ensure that the eventArgs.EnableAjax = false; line is executed in IE 11.

You could also try to place a simple Button control on the page and try to download a file outside the grid with the same file content.

If you continue to experience problems with this, please open a regular support with a sample, runnable project that replicates the issue attached, so we can test it locally.


Kind Regards,
Konstantin Dikov
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Boris
Top achievements
Rank 1
answered on 23 Apr 2015, 06:23 PM

The eventArgs.EnableAjax = false call definitely fires in Internet Explorer.  

I've also tried duplicating the call from a button (ordinary ASP.net button) outside of the grid and that fails in IE, in the same way as the Grid.  (Actually I suppose that proves that it's not specifically a Telerik problem.)

I don't believe it's practical at this time to create a sample runnable project, given the complexity of the problem page, but I'll see what I can do.

0
Boris
Top achievements
Rank 1
answered on 24 Apr 2015, 01:25 PM

Apologies to one and all.  It appears that this problem was entirely unrelated to Telerik.  Entirely a matter of download code (of where there appear to be many varied opinions floating about the net.)

(If anyone's interested, this is the version that helped me fix the problem.  http://www.aspsnippets.com/Articles/Upload-and-Download-files-from-SQL-Server-Database-in-ASPNet.aspx)

 

0
Konstantin Dikov
Telerik team
answered on 28 Apr 2015, 12:01 PM
Hi Boris,

I am glad to see that you were able to locate the root of the problem and that everything is working correctly on your end.

Also, thank you for sharing your findings about the issue. Hopefully, they could help others with similar problem.


Best Regards,
Konstantin Dikov
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
Grid
Asked by
Boris
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Boris
Top achievements
Rank 1
Share this question
or