Showing The Download Dialog Box?

Discussion in 'ASP .Net' started by Husam, Mar 17, 2008.

  1. Husam

    Husam Guest

    Hi EveryBody:

    I was downloading a lot of file by using the following code:

    Response.AddHeader("Content-Disposition", "attachment; filename=" + filename)
    response.BinaryWrite(buffer() as byte)

    but I discover for large data this will be a problem because every time I
    tried to download large data I error raise toled me that system out of memory.

    I tried another way to upload and download to web server that really worked
    with me very well but I face a problem when I download any file and I did not
    use the response for writing it that the Download dialog box dose not appear
    so some body can help me and toled me how can I use
    My.Computer.Network.DownloadFile
    or WebClinte class download method and still can show the download dialog
    box I
    tried
    Response.addheader(value as string,name as string) but did not work.

    any help will be appreciated

    reagard's

    Husam
    Husam, Mar 17, 2008
    #1
    1. Advertising

  2. On Mar 17, 11:12 am, Husam <> wrote:
    > Hi EveryBody:
    >
    > I was downloading a lot of file by using the following code:
    >
    >  Response.AddHeader("Content-Disposition", "attachment; filename=" + filename)
    >  response.BinaryWrite(buffer() as byte)
    >
    >  but I discover for large data this will be a problem because every time I
    > tried to download large data I error raise toled me that system out of memory.
    >
    > I tried another way to upload and download to web server that really worked
    > with me very well but I face a problem when I download any file and I did not
    > use the response for writing it that the Download dialog box dose not appear
    > so some body can help me and toled me how can I use
    > My.Computer.Network.DownloadFile
    > or WebClinte class download method and still can show the download dialog
    > box I
    > tried
    > Response.addheader(value as string,name as string) but did not work.
    >
    > any help will be appreciated
    >
    > reagard's
    >
    > Husam


    What .NET version do you use?

    There is a fix for 1.0-1.1, see http://support.microsoft.com/kb/823409
    Alexey Smirnov, Mar 17, 2008
    #2
    1. Advertising

  3. Husam

    Fred Guest

    Dans : news:D,
    Husam disait :
    > Hi EveryBody:
    >
    > I was downloading a lot of file by using the following code:
    >
    > Response.AddHeader("Content-Disposition", "attachment; filename=" +
    > filename) response.BinaryWrite(buffer() as byte)
    >
    > but I discover for large data this will be a problem because every
    > time I tried to download large data I error raise toled me that
    > system out of memory.


    Another idea :
    The default max length (with .NET 2.0) is 4Mb.
    Did you check this ?
    Add this element to your your web.config if not.
    <httpRuntime maxRequestLength = "..." />

    PS : I use Me.Response.TransmitFile

    --
    Fred
    Fred, Mar 17, 2008
    #3
  4. Husam

    Husam Guest

    I am using ASP.Net 2.0 version

    "Alexey Smirnov" wrote:

    > On Mar 17, 11:12 am, Husam <> wrote:
    > > Hi EveryBody:
    > >
    > > I was downloading a lot of file by using the following code:
    > >
    > > Response.AddHeader("Content-Disposition", "attachment; filename=" + filename)
    > > response.BinaryWrite(buffer() as byte)
    > >
    > > but I discover for large data this will be a problem because every time I
    > > tried to download large data I error raise toled me that system out of memory.
    > >
    > > I tried another way to upload and download to web server that really worked
    > > with me very well but I face a problem when I download any file and I did not
    > > use the response for writing it that the Download dialog box dose not appear
    > > so some body can help me and toled me how can I use
    > > My.Computer.Network.DownloadFile
    > > or WebClinte class download method and still can show the download dialog
    > > box I
    > > tried
    > > Response.addheader(value as string,name as string) but did not work.
    > >
    > > any help will be appreciated
    > >
    > > reagard's
    > >
    > > Husam

    >
    > What .NET version do you use?
    >
    > There is a fix for 1.0-1.1, see http://support.microsoft.com/kb/823409
    >
    Husam, Mar 17, 2008
    #4
  5. Husam

    Fred Guest

    Dans : news:,
    Fred disait :
    > Dans : news:D,
    > Husam disait :
    >> Hi EveryBody:
    >>
    >> I was downloading a lot of file by using the following code:
    >>
    >> Response.AddHeader("Content-Disposition", "attachment; filename=" +
    >> filename) response.BinaryWrite(buffer() as byte)
    >>
    >> but I discover for large data this will be a problem because every
    >> time I tried to download large data I error raise toled me that
    >> system out of memory.

    >
    > Another idea :
    > The default max length (with .NET 2.0) is 4Mb.
    > Did you check this ?
    > Add this element to your your web.config if not.
    > <httpRuntime maxRequestLength = "..." />
    >
    > PS : I use Me.Response.TransmitFile


    Sorry, This is for upload ...


    --
    Fred
    Fred, Mar 17, 2008
    #5
  6. Husam

    André de Sousa Araujo

    Joined:
    Oct 7, 2009
    Messages:
    1
    I had a problem, when I was debbugging my application the dialog box always appears, but when I moved it to my server, It doesn't work.

    I discovered that in Tools >> Internet Options >> Security >> Personalized Level >> Donwloads >> The fisrt Option ...

    In portuguese: "Aviso automático para downloads de arquivo" may be check in ON (or Habilitar in portuguese). In English, probaly "Automatized File Download".

    It's work for me! ;-)
    André de Sousa Araujo, Oct 7, 2009
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    0
    Views:
    532
    Guest
    Jul 28, 2004
  2. Don Peters
    Replies:
    2
    Views:
    549
    Don Peters
    Oct 26, 2003
  3. =?Utf-8?B?QUNhdW50ZXI=?=

    download dialog box

    =?Utf-8?B?QUNhdW50ZXI=?=, Dec 21, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    359
    =?Utf-8?B?QUNhdW50ZXI=?=
    Dec 21, 2004
  4. Henry Lee
    Replies:
    1
    Views:
    8,937
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    May 3, 2006
  5. Thomas Matthews

    Showing an picture in a dialog box (WinAPI)

    Thomas Matthews, May 6, 2005, in forum: C Programming
    Replies:
    6
    Views:
    944
    Richard Bos
    May 9, 2005
Loading...

Share This Page