Results 1 to 4 of 4

Thread: Download attachment in IE10 not working

  1. #1
    Sencha User
    Join Date
    Jul 2013
    Location
    India
    Posts
    16

    Default Download attachment in IE10 not working

    Hi,

    I am trying to download an attachment in on a click event. The code after the clicking event is pasted below:

    Code:
    Ext.Ajax.request({    url: '/DPS_BE/StudyVersionControlServlet?action=downloadVerStudy',
        method:'GET',
        params: {
            stuID : study,
            version : version 
        },
        success: function(response){ 
    
            box.hide();
            var link = document.createElement("a");
            link.download = studyName+'_V'+version+'.doc';
            link.href = '/DPS_BE/temp/workingSOVDir/sov.doc';
            link.click(); 
    
    
        },
        failure: function(response){
            box.hide();
            Ext.Msg.alert('Server Error');
        }
    
    });

    Now the doc file is downloading perfectly fine in chrome, but NOT in IE-10. Please let me know the solution ASAP, as it is halting my crucial deliverable.

    N.B.: I have tried to set the response type to "text/html" , "application/msword", "text/plain". But no success..

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791
    Answers
    585

    Default

    It doesn't look like IE has support for the download attribute:

    https://developer.mozilla.org/en-US/...Specifications

    The standard way to do downloads is using a Content-Disposition header, often in conjunction with a hidden iframe.

  3. #3
    Sencha User
    Join Date
    Jul 2013
    Location
    India
    Posts
    16

    Default

    Thanks for the help.
    Can I get the code snippet for download using Iframe?

  4. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791
    Answers
    585

    Default

    Discussed here, among other places:

    http://www.sencha.com/forum/showthread.php?246673

    In your case you don't need a form, for a GET request it's just a case of setting the src.

    The key thing is the server-side header. You can find out more about that with a quick Google search.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •