Results 1 to 4 of 4

Thread: How to force a download dialog box?

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2001
    Location
    Virginia
    Posts
    7

    Unhappy How to force a download dialog box?

    Hi,
    I have a problem with downloading the file.
    I provide a list of all the files uploaded to a particular item in my web page. All my uploaded files are stored in a directory on the web server. When the user clicks on one of those links, I need to let him download it. It shouldn't display the contents of the uploaded file.

    Setting Response.ContentType doesn't seem to work.

    How can this be done?

    Thanks,
    Soujanya

  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Unfortunately, you don't have alot of control over this one. For instance, if you click on a PDF file and want it to download, it doesn't (well it sort of does).. it displays in the browser and Acrobat loads in the background as an ActiveX Server. The filetype is what determines how the browser will handle the file and that depends on how each user has it set up to handle different file types. Using my example above, if I didn't have Acrobat installed, the file would prompt me to download it.
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  3. #3
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    In theory, shouldn't the browser handle the downloaded file based on the MIME type, rather than the file extension? IE seems to sometimes act based on the file extension when it would make more sense to act depending on the MIME type.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  4. #4
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    I guess the best thing you can do is just .zip everything. Or, you could make everything with your own extenxion, like .dload or somehting, and then just have the users remove the .dload.

    like file1.pdf.dload --> file1.pdf

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

Posting Permissions

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



Click Here to Expand Forum to Full Width