Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
1.22/5 (2 votes)
See more:
hi,

anyone know this?

asp.net code for upload resume with size 300kb only...& resume datatype is varbinary(MAX)....
Posted
Updated 12-Apr-17 22:26pm
v2

 
Share this answer
 
you have to update request length into web.config.

update your web.config as below, after updating web.config you are allow to upload file upto 2GB

HTML
<system.web>

<httpruntime executiontimeout="2400" maxrequestlength="40960" />

</system.web> 
 
Share this answer
 
Add below html content in your aspx page
XML
<asp:FileUpload id="FileUploadControl" runat="server" />
    <asp:Button runat="server" id="btnUpload" text="Upload" onclick="btnUpload_Click" />


C#
protected void btnUpload_Click(object sender, EventArgs e)

{

    if(FileUploadControl.HasFile)

    {

        try

        {

            string filename = Path.GetFileName(FileUploadControl.FileName);

            FileUploadControl.SaveAs(Server.MapPath("~/") + filename);

        }

        catch(Exception ex)

        {

            //write error handling code

        }

    }

}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900