File download size limit

Discussion in 'ASP General' started by tjfdownsouth, Jun 30, 2006.

  1. tjfdownsouth

    tjfdownsouth Guest

    I have a site that allows a person to log in and get a list of files to
    download for them. If the file size is under 65MB then everything is fine,
    they click the download button and the save box pops up. But if the file is
    larger than 65MB the page sits and processes until it times out. I can't
    figure it out becaus a 64MB file loads immediately for download while one
    slightly larger hangs up.

    Any assistance on this will be greatly appreciated. Tim
     
    tjfdownsouth, Jun 30, 2006
    #1
    1. Advertising

  2. "tjfdownsouth" <> wrote in message
    news:...
    > I have a site that allows a person to log in and get a list of files to
    > download for them. If the file size is under 65MB then everything is

    fine,
    > they click the download button and the save box pops up. But if the file

    is
    > larger than 65MB the page sits and processes until it times out. I can't
    > figure it out becaus a 64MB file loads immediately for download while one
    > slightly larger hangs up.
    >
    > Any assistance on this will be greatly appreciated. Tim


    Is the link to the file supplied a direct URL for the file in a web folder
    or is it a link to an ASP page which streams the file content to the client.

    If the latter then it may be a buffer size limit. You could increase the
    buffer limit but the real solution would be to code the ASP to allow the
    file to be streamed properly rather than being buffered. This involves two
    things: make sure Response.Buffer = False and don't use BinaryWrite to send
    the whole contents of the file at once.
     
    Anthony Jones, Jul 3, 2006
    #2
    1. Advertising

  3. tjfdownsouth

    tjfdownsouth Guest

    This is the code I am using to download the file when a user click the
    download button:

    FileInfo targetFile = new FileInfo(filePath);
    Response.Clear();
    Response.AddHeader("Content-Disposition", "attachment; filename=" +
    targetFile.Name);
    Response.AddHeader("Content_Length", targetFile.Length.ToString());
    Response.ContentType = "application/octet-stream";
    Response.WriteFile(targetFile.FullName);
    Response.End();

    "Anthony Jones" wrote:

    >
    > "tjfdownsouth" <> wrote in message
    > news:...
    > > I have a site that allows a person to log in and get a list of files to
    > > download for them. If the file size is under 65MB then everything is

    > fine,
    > > they click the download button and the save box pops up. But if the file

    > is
    > > larger than 65MB the page sits and processes until it times out. I can't
    > > figure it out becaus a 64MB file loads immediately for download while one
    > > slightly larger hangs up.
    > >
    > > Any assistance on this will be greatly appreciated. Tim

    >
    > Is the link to the file supplied a direct URL for the file in a web folder
    > or is it a link to an ASP page which streams the file content to the client.
    >
    > If the latter then it may be a buffer size limit. You could increase the
    > buffer limit but the real solution would be to code the ASP to allow the
    > file to be streamed properly rather than being buffered. This involves two
    > things: make sure Response.Buffer = False and don't use BinaryWrite to send
    > the whole contents of the file at once.
    >
    >
    >
    >
     
    tjfdownsouth, Jul 6, 2006
    #3
  4. "tjfdownsouth" <> wrote in message
    news:...
    > This is the code I am using to download the file when a user click the
    > download button:
    >
    > FileInfo targetFile = new FileInfo(filePath);
    > Response.Clear();
    > Response.AddHeader("Content-Disposition", "attachment; filename="

    +
    > targetFile.Name);
    > Response.AddHeader("Content_Length",

    targetFile.Length.ToString());
    > Response.ContentType = "application/octet-stream";
    > Response.WriteFile(targetFile.FullName);
    > Response.End();
    >


    WriteFile is a member of HttpResponse in ASP.NET. You've posted to a
    Classic ASP NG.

    However it does sound like you are exceeding the server buffer. Replace
    Response.Clear() with Response.Buffer = False.



    > "Anthony Jones" wrote:
    >
    > >
    > > "tjfdownsouth" <> wrote in message
    > > news:...
    > > > I have a site that allows a person to log in and get a list of files

    to
    > > > download for them. If the file size is under 65MB then everything is

    > > fine,
    > > > they click the download button and the save box pops up. But if the

    file
    > > is
    > > > larger than 65MB the page sits and processes until it times out. I

    can't
    > > > figure it out becaus a 64MB file loads immediately for download while

    one
    > > > slightly larger hangs up.
    > > >
    > > > Any assistance on this will be greatly appreciated. Tim

    > >
    > > Is the link to the file supplied a direct URL for the file in a web

    folder
    > > or is it a link to an ASP page which streams the file content to the

    client.
    > >
    > > If the latter then it may be a buffer size limit. You could increase

    the
    > > buffer limit but the real solution would be to code the ASP to allow the
    > > file to be streamed properly rather than being buffered. This involves

    two
    > > things: make sure Response.Buffer = False and don't use BinaryWrite to

    send
    > > the whole contents of the file at once.
    > >
    > >
    > >
    > >
     
    Anthony Jones, Jul 6, 2006
    #4
  5. tjfdownsouth

    tjfdownsouth Guest

    Anthony I tried your suggestion and it is still having trouble, it is not
    having an error but it still does not operate the same. If the file is less
    than 65MB it immediately pops up a dialog if it is more it just sits there
    processing. Thanks for your help I will try in the .net forum also.

    Tim

    "Anthony Jones" wrote:

    >
    > "tjfdownsouth" <> wrote in message
    > news:...
    > > This is the code I am using to download the file when a user click the
    > > download button:
    > >
    > > FileInfo targetFile = new FileInfo(filePath);
    > > Response.Clear();
    > > Response.AddHeader("Content-Disposition", "attachment; filename="

    > +
    > > targetFile.Name);
    > > Response.AddHeader("Content_Length",

    > targetFile.Length.ToString());
    > > Response.ContentType = "application/octet-stream";
    > > Response.WriteFile(targetFile.FullName);
    > > Response.End();
    > >

    >
    > WriteFile is a member of HttpResponse in ASP.NET. You've posted to a
    > Classic ASP NG.
    >
    > However it does sound like you are exceeding the server buffer. Replace
    > Response.Clear() with Response.Buffer = False.
    >
    >
    >
    > > "Anthony Jones" wrote:
    > >
    > > >
    > > > "tjfdownsouth" <> wrote in message
    > > > news:...
    > > > > I have a site that allows a person to log in and get a list of files

    > to
    > > > > download for them. If the file size is under 65MB then everything is
    > > > fine,
    > > > > they click the download button and the save box pops up. But if the

    > file
    > > > is
    > > > > larger than 65MB the page sits and processes until it times out. I

    > can't
    > > > > figure it out becaus a 64MB file loads immediately for download while

    > one
    > > > > slightly larger hangs up.
    > > > >
    > > > > Any assistance on this will be greatly appreciated. Tim
    > > >
    > > > Is the link to the file supplied a direct URL for the file in a web

    > folder
    > > > or is it a link to an ASP page which streams the file content to the

    > client.
    > > >
    > > > If the latter then it may be a buffer size limit. You could increase

    > the
    > > > buffer limit but the real solution would be to code the ASP to allow the
    > > > file to be streamed properly rather than being buffered. This involves

    > two
    > > > things: make sure Response.Buffer = False and don't use BinaryWrite to

    > send
    > > > the whole contents of the file at once.
    > > >
    > > >
    > > >
    > > >

    >
    >
    >
     
    tjfdownsouth, Jul 8, 2006
    #5
    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. Don
    Replies:
    12
    Views:
    25,474
  2. =?Utf-8?B?dGpmZG93bnNvdXRo?=

    File download size limit

    =?Utf-8?B?dGpmZG93bnNvdXRo?=, Jul 8, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    8,038
    sains23
    Mar 14, 2008
  3. Replies:
    1
    Views:
    1,088
    Victor Bazarov
    Jun 28, 2005
  4. Amod
    Replies:
    1
    Views:
    436
    Jonathan Mcdougall
    Nov 14, 2005
  5. andreim

    limit file download size

    andreim, Jul 29, 2007, in forum: Ruby
    Replies:
    4
    Views:
    162
    Gregory Brown
    Aug 1, 2007
Loading...

Share This Page