How can i create File downloading utility in ASP.NET 2.0

Last post 11-29-2007 2:10 AM by lakul. 4 replies.

Sort Posts:

  • How can i create File downloading utility in ASP.NET 2.0

    11-22-2007, 12:41 AM
    • Loading...
    • lakul
    • Joined on 09-28-2007, 3:51 AM
    • Baroda
    • Posts 5

    Hi,

    i successfully create uploading facility in the ASP.net 2.0 by following code.

    FileUpload1.SaveAs("C:\Uploads\" & FileUpload1.FileName). its working fine upto 4 MB

    My problem is :

    1)How i can increase File size capacity for Uploading data.

    2)I want to create web page that can facilitates user to Download file from local machine or from remote machine.

    Lakul.

    Lakul
    Software Developer.
  • Re: How can i create File downloading utility in ASP.NET 2.0

    11-22-2007, 1:09 AM
    • Loading...
    • jimmy q
    • Joined on 11-02-2006, 9:01 AM
    • Australia
    • Posts 2,496
    • Moderator

    lakul:
    1)How i can increase File size capacity for Uploading data.

    By default the machine.config limits upload size to 4 mb. This can be modified by changing this maxRequestLength value

    You can either modify it to the machine.config or can override it in individual web.configs

    <system.web>

    <httpRuntime maxRequestLength="10240"/>

    </system.web>

     

    To download these files, jsut create a hyperlink that refers to the file path where you have saved the file to the file system.

     

  • Re: How can i create File downloading utility in ASP.NET 2.0

    11-22-2007, 1:38 AM
    • Loading...
    • lakul
    • Joined on 09-28-2007, 3:51 AM
    • Baroda
    • Posts 5

    hi Jimmi

    Thanx for a straight & fast reply. its works smoothly. Yes

    i want to knw one more thing that how to create file downloading utility in ASP.NET 2.0. Plz give me hint, if u can.

    Thanx.

    LAKUL

    Lakul
    Software Developer.
  • Re: How can i create File downloading utility in ASP.NET 2.0

    11-25-2007, 8:58 PM
    Answer

     

    lakul:
    2)I want to create web page that can facilitates user to Download file from local machine or from remote machine.

    Hi lakul,

    If the file is placed in the file system, perhaps you can try the following code snippet to download a
    file.
    protected void Page_Load(object sender, EventArgs e)
    {
            Response.WriteFile("~/App_Data/test.zip");
    }

    If the file is stored in a DataBase, here is a thread which is similar to this situation, please check
    the URL below.
    http://forums.asp.net/t/1179885.aspx

    Hope this Information is helpful!
    Xun

     

    Regards,
    Xun Ye.
    Microsoft Online Community Support
    Please remember to click “Mark as Answer” on the post that
    helps you, and to click “Unmark as Answer” if a marked post
    does not actually answer your question. This can be beneficial
    to other community members reading the thread.
  • Re: How can i create File downloading utility in ASP.NET 2.0

    11-29-2007, 2:10 AM
    • Loading...
    • lakul
    • Joined on 09-28-2007, 3:51 AM
    • Baroda
    • Posts 5

    Thanx Bro,

    i wirte the code in a way that it uploads files at a specified folder in C drive. As u stated both method to download such file. it is help full to me.

    Lakul
    Software Developer.
Page 1 of 1 (5 items)
Microsoft Communities
Page view counter