Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. How Yahoo Download works?

How Yahoo Download works?

Scheduled Pinned Locked Moved ASP.NET
question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SABhatti
    wrote on last edited by
    #1

    Can someone tell me how yahoo download option works? because even if I disable option to confirm download under Folder Options --> File Types then also it give me option to open or save the file, but my own program does not do this I'm using this code: Response.Clear() Response.ContentType = "application/vnd.ms-Excel" Response.AddHeader("content-disposition", "attachement; filename=" & strFileName) Response.WriteFile(strPath & strFileName) Response.End() but it does not work if disable/uncheck the above option in file types, but yahoo download option still works..:-D:( -----

    M 1 Reply Last reply
    0
    • S SABhatti

      Can someone tell me how yahoo download option works? because even if I disable option to confirm download under Folder Options --> File Types then also it give me option to open or save the file, but my own program does not do this I'm using this code: Response.Clear() Response.ContentType = "application/vnd.ms-Excel" Response.AddHeader("content-disposition", "attachement; filename=" & strFileName) Response.WriteFile(strPath & strFileName) Response.End() but it does not work if disable/uncheck the above option in file types, but yahoo download option still works..:-D:( -----

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi SABhatti,

      SABhatti wrote:

      I thought mayyou can help me with this.

      Thank you for trusting me :)

      SABhatti wrote:

      yahoo download option still works..

      I wish I could see how their developers code.

      SABhatti wrote:

      but it does not work if disable/uncheck the above option in file types

      Well, even I disable this option, I still got the popup file download dialog box when I run your sample code :confused:. + In this case, you might try placing a delimitor "\r\n" at the end of the filename:

      Response.AddHeader("content-disposition", "attachement; filename=" & strFileName & "\r\n")

      + You can also try to statically add the Content-Disposition header field to a sample static .xls file in the IIS snap-in, then you try to browse the file in IE and see its behaviour.

      S 1 Reply Last reply
      0
      • M minhpc_bk

        Hi SABhatti,

        SABhatti wrote:

        I thought mayyou can help me with this.

        Thank you for trusting me :)

        SABhatti wrote:

        yahoo download option still works..

        I wish I could see how their developers code.

        SABhatti wrote:

        but it does not work if disable/uncheck the above option in file types

        Well, even I disable this option, I still got the popup file download dialog box when I run your sample code :confused:. + In this case, you might try placing a delimitor "\r\n" at the end of the filename:

        Response.AddHeader("content-disposition", "attachement; filename=" & strFileName & "\r\n")

        + You can also try to statically add the Content-Disposition header field to a sample static .xls file in the IIS snap-in, then you try to browse the file in IE and see its behaviour.

        S Offline
        S Offline
        SABhatti
        wrote on last edited by
        #3

        Well I really wonder How it works on your system? did you uncheck the option for the file type which you downloading?:-D because there are lot of file types and one has to set the confirm option for each type individually. Anyhow thanks for your help, I have used the \r\n at end of file, but it did not work for contenttype application/vnd.ms-excel, but if I change the content type to unknown like xxx/xxx or application/x-msdownload then it works with \r\n at the end of file:laugh:, but in this case I faced another problem, -- IE show the file type as unknown -- does not open optin (just give save and cancel option which is good) -- in save dialog set the aspx file name as default name without ext (i want it to set the origianl excel filename as default) -- on clicking ok, save the file as unknow file type -- but on double clicking the saved file, file opens in excel ;P:confused: I am working on it to set the default name and type, lets c if i get any success. further help is highly appreciated:-D -----

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups