Results 1 to 6 of 6

Thread: FAO Az and others

  1. #1
    Senior Member Shad's Avatar
    Join Date
    Jul 2003
    Location
    In front
    Posts
    2,782
    Thanks
    23
    Thanked
    42 times in 25 posts

    FAO Az and others

    I'm having a problem using location.href in IE6. The codeworks fine in Opera and Mozilla.

    Basically there's a frameset with 2 frames. When a link in the right hand frame is clicked, a confirm dialog pops up to determine whether or not the user wishes to view or download the file. If they want to dl it, the frame *should* redirect to a script which sends them the file (as opposed to IE trying to open it in a browser window). As I say this is working nicely on other browsers.

    It seems location.href is somewhat buggy in IE, so is there a decent workaround? I've tried opening the file-save script in a new window with window.open, but once the dl is complete the window stays there.

    Bit stuck really
    Simon


  2. #2
    HEXUS.net Webmaster
    Join Date
    Jul 2003
    Location
    UK
    Posts
    3,108
    Thanks
    1
    Thanked
    0 times in 0 posts
    you tried
    location.url=blah

  3. #3
    Senior Member Shad's Avatar
    Join Date
    Jul 2003
    Location
    In front
    Posts
    2,782
    Thanks
    23
    Thanked
    42 times in 25 posts
    Quote Originally Posted by Az
    you tried
    location.url=blah
    Yup, same result. Not even an error, just doesn't do anything!
    Simon


  4. #4
    HEXUS.net Webmaster
    Join Date
    Jul 2003
    Location
    UK
    Posts
    3,108
    Thanks
    1
    Thanked
    0 times in 0 posts
    Actually ignore that, it's been deprecated. I take it this is down to the document being a word document or something similar which IE thinks it can open in a browser window whereas you want it to force a download ?

    You can force the file to download by modifying the page header to include

    Content-Disposition: attachment, filename=myFile.pdf

    or the equivalent. It depends on what language you are using as to how you define the header

  5. #5
    HEXUS.net Webmaster
    Join Date
    Jul 2003
    Location
    UK
    Posts
    3,108
    Thanks
    1
    Thanked
    0 times in 0 posts
    and it's not

    location.url =

    it's just

    location =

    as I said, that's been deprecated though but you might find it works. If so then you'll need a little browser detection script

  6. #6
    Senior Member Shad's Avatar
    Join Date
    Jul 2003
    Location
    In front
    Posts
    2,782
    Thanks
    23
    Thanked
    42 times in 25 posts
    Quote Originally Posted by Az
    Actually ignore that, it's been deprecated. I take it this is down to the document being a word document or something similar which IE thinks it can open in a browser window whereas you want it to force a download ?

    You can force the file to download by modifying the page header to include

    Content-Disposition: attachment, filename=myFile.pdf

    or the equivalent. It depends on what language you are using as to how you define the header
    Yes, that's one of the things the script does. Tried just location and did the same thing. Really frustraiting
    Simon


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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