Results 1 to 9 of 9
  1. #1
    2 Star Lounger
    Join Date
    Dec 2001
    Location
    Houma, Louisiana, USA
    Posts
    100
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Forcing a file to download (2003)

    In a web page I'm creating for an in-house project I want to create a link to a file which will force the user to download the file and save it to their own "my documents" folder. It's stored on our local server, so the path is something like h:Access courseexercise.zip. How do I create the link to have the individual user download the file?

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    Cincinnati, Ohio, USA
    Posts
    7,089
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forcing a file to download (2003)

    If you link straight to the zip file, such as
    <pre>download zip file</pre>

    the user will likely be prompted to download or open the file. I say "likely" because it depends largely on how the file associations are set up on the client system; if they have a default action assigned to zip files, you are going to be fighting it. The zip format more often than not produces a prompt, so I think you should be safe.
    -Mark

  3. #3
    2 Star Lounger
    Join Date
    Dec 2001
    Location
    Houma, Louisiana, USA
    Posts
    100
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Forcing a file to download (2003)

    The code I put in is Download exercise files When you click on the link, it just opens a winzip window. I wanted it to come up with the "file download" window. I think the problem is that i'm not using a file off the web, because if I reference a file at a www location it does ask me to download. It doesn't seem to do that for local files though.

    After re-reading your post, I see that you said with a zip file, I'd probably be fighting it. I guess that's my problem then. Any suggestions about how to get around the file association defaults?

  4. #4
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    Cincinnati, Ohio, USA
    Posts
    7,089
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forcing a file to download (2003)

    You could try creating self-extracting zip files with an EXE extension, which should ALWAYS prompt a user for an action...but outside of that, I don't think there's much that can be done.
    -Mark

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Forcing a file to download (2003)

    <P ID="edit" class=small>(Edited by jscher2000 on 16-Apr-04 10:16. )</P>There are many differences between local and remote files. Some relate to settings in Tools>Internet Options...>Security tab>Custom Level and other relate to the defintion of "download," because the Save or Open prompt is linked to the checkbox in Windows Explorer's Tools>Folder Options...>File Types tab>ZIP>Advanced... dialog to "Confirm Open After Download".

    Regarding the second question... I had a similar issue over on the Web Development board (here), and an ASP solution was suggested. If you are running ASP on your server, you should consider that option. (If you are totally unfamiliar with ASP, then perhaps not.)

  6. #6
    2 Star Lounger
    Join Date
    Dec 2001
    Location
    Houma, Louisiana, USA
    Posts
    100
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Forcing a file to download (2003)

    Should the Confirm Open After Download box be checked or not? It is checked on my system.

    And unfortuntely I dont have a clue about ASP.

    I was really hoping there would be some simple little piece of code I just needed to add to the command line.

  7. #7
    2 Star Lounger
    Join Date
    Dec 2001
    Location
    Houma, Louisiana, USA
    Posts
    100
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Forcing a file to download (2003)

    Yep. The self extracting zip file worked like a charm. That solves that problem. Thanks for your help WyllyWylly and jscher2000.

  8. #8
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    Cincinnati, Ohio, USA
    Posts
    7,089
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forcing a file to download (2003)

    To use one of my favourite phrases of late.... <big>Good Stuff!</big> Glad that it was a solution for you!
    -Mark

  9. #9
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Forcing a file to download (2003)

    I like to have the box checked, that generates the dialog.

    I don't like to have people routine run EXE files to obtain data. I think it could potentially condition them not to be wary of executable content (what EXE almost always symbolizes). So while using EXEs as a short term workaround, I'd encourage you to continue thinking about alternatives.

Posting Permissions

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