Submit Your Article Forum Rules

Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: CSV File Downloads in IE8

  1. #1
    Member
    Join Date
    Oct 2007
    Posts
    56

    CSV File Downloads in IE8

    I'm having a nightmare getting IE to download simple CSV files.

    The CSV is genarated via a form submission and i've tried two methods as follows...

    1. window.open..

    This keeps bleeping without any info bar or message, I added the domain to popup blocker, no good, I added domain to trusted sites, still no good, I then had to edit custom level for trusted sites and enable 'prompting' for file downloads.

    Finanly this works, the problem is this is in no way user friendly, average Joe doesn't know how to edit these settings, nor should average Joe have to, especially considering the potential for opening your PC up to serious securtiy risk by mistake and changing wrong settings.

    2. document.location.href

    This method doesn't require any browser settings to be altered, however, every time the CSV file is requested, the info bar pops up saying it has blocked the file download and you have to right click and accept the download, only the file doesn't download the browser refreshes itself, the webpage is reset and you have to re-request the file, only then will it actually download.

    I cannot find anyway of telling IE to allow these downloads from this domain, doing all the browser setting as per option 1 makes no difference and the download info bar pop-up continues to show.

    Is there any way round this nightmare? I don't have any problems with either method in firefox!

    In my server side code i've tried printing the content to the browser as both dispositions (inline / attachment) it doesn't make any difference.

    can anyone help?

    Thanks 1DMF.

  2. #2
    WebProWorld MVP wige's Avatar
    Join Date
    Jun 2006
    Posts
    3,138

    Re: CSV File Downloads in IE8

    Are you trying to download the file using Javascript?
    The best way to learn anything, is to question everything.
    WigeDev - Freelance web and software development

  3. #3
    WebProWorld MVP morestar's Avatar
    Join Date
    Jun 2007
    Location
    Toronto, Ontario (Burlington)
    Posts
    4,250

    Re: CSV File Downloads in IE8

    So when you use the second method, the (document.location.href) does that go directly to the file in question? or to a page where the user can download it?
    Join a free dating site and meet single people in your area.
    Submit your content at my content publishing site and promote your business, services or opinions.

  4. #4
    Member
    Join Date
    Oct 2007
    Posts
    56

    Re: CSV File Downloads in IE8

    1. yes it's via Javascript.

    2. sort of, it's not a file or page, it's a perl script which provides the file.

    The real annoying thing is, it works fine for MP3 files, no popup, no security message, it opens Windows Media Player and tries to play the file, which fails of course as the content is really plain ole text.

    I don't think IE is going to let me do this, do you?

    I've even tried an iframe and then changed its source attribute, but get the same problem, I have none of these issues in FireFox

  5. #5
    WebProWorld MVP morestar's Avatar
    Join Date
    Jun 2007
    Location
    Toronto, Ontario (Burlington)
    Posts
    4,250

    Re: CSV File Downloads in IE8

    I think you will find the hack but opening csv file can be a slight security risk and so IE is giving you a problem...

    I know next to nothing about PERL but I'm sure others will be able to help you find a solution...
    Join a free dating site and meet single people in your area.
    Submit your content at my content publishing site and promote your business, services or opinions.

  6. #6
    Member
    Join Date
    Oct 2007
    Posts
    56

    Re: CSV File Downloads in IE8

    I think you will find the hack but opening csv file can be a slight security risk and so IE is giving you a problem...
    opening any file is a security risk, so why doesn't it happen to mp3's when they aren't even an mp3 file?

    it's very frustrating to say the least, i'm not trying to do anything bad, or harmfull, i'm trying to facilitate a specific feature a user has requested... I really don't want to have to tell people to use FireFox, but i am running out of options fast

  7. #7
    WebProWorld MVP morestar's Avatar
    Join Date
    Jun 2007
    Location
    Toronto, Ontario (Burlington)
    Posts
    4,250

    Re: CSV File Downloads in IE8

    well I think the security risk for mp3s might be a bit stricter, im not at all sure, just assuming on this...
    Join a free dating site and meet single people in your area.
    Submit your content at my content publishing site and promote your business, services or opinions.

  8. #8
    Member
    Join Date
    Oct 2007
    Posts
    56

    Re: CSV File Downloads in IE8

    I've given up, ok call me defeatest, but it was simpler to add an extra step, which updates the DOM with a hyperlink to the same perl program, this works as intended!

    oh well, I think we can safely say ever since XP SP2 & Vista MS are the kings of making users have to click on things far more often than they ought too!

  9. #9
    WebProWorld MVP morestar's Avatar
    Join Date
    Jun 2007
    Location
    Toronto, Ontario (Burlington)
    Posts
    4,250

    Re: CSV File Downloads in IE8

    Well stay tuned...a well skilled master techi may stop by in the next little while and know/figure out the solution for you...
    Join a free dating site and meet single people in your area.
    Submit your content at my content publishing site and promote your business, services or opinions.

  10. #10
    WebProWorld MVP wige's Avatar
    Join Date
    Jun 2006
    Posts
    3,138

    Re: CSV File Downloads in IE8

    Most likely, you have to send a different header to force the browser to see the file as something to download rather than to display. MP3 files are different because that is an extension that the browser inherently knows what to do with. CSV is not an extension that IE recognizes by default, so you have to provide additional headers. Since the file is being served via Perl, you change the output headers at the beginning of the script. Let me check my CSV downloader to see what headers you need to add...


    Content-type: application/octet-stream
    Content-Disposition: attachment; filename="name_of_file.csv"

    name_of_file.csv is the default name that you want the file dialog box to suggest for the user to save the file as locally.

    How you actually add the header will depend on how your Perl is setup, most likely through CGI.
    The best way to learn anything, is to question everything.
    WigeDev - Freelance web and software development

Page 1 of 2 12 LastLast

Similar Threads

  1. File downloads
    By rkstevens in forum Web Programming Discussion Forum
    Replies: 4
    Last Post: 03-26-2008, 07:58 AM
  2. Reach Metrics on File Downloads?
    By musicmmh23 in forum Content Discussion Forum
    Replies: 3
    Last Post: 06-28-2007, 05:56 AM
  3. How to converter video file into a flash file ,with effect?
    By andy_lucky in forum Flash Discussion Forum
    Replies: 0
    Last Post: 04-04-2006, 11:37 AM
  4. Windows 2000 Slow with File Open and File Save Dialog Boxes
    By steve0 in forum IT Discussion Forum
    Replies: 2
    Last Post: 09-15-2005, 05:27 PM
  5. Blocking graphic file right-click downloads
    By Sereniti in forum Web Programming Discussion Forum
    Replies: 50
    Last Post: 11-08-2003, 03:23 PM

Posting Permissions

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