1. Add <system. Web> in Web. config:
<Httphandlers>
<Add verb = "*" Path = "telerik. raduploadprogresshandler. aspx" type = "telerik. webcontrols. raduploadprogresshandler, radupload. net2"/>
</Httphandlers>
<Httpmodules>
<Add name = "raduploadmodule" type = "telerik. webcontrols. raduploadhttpmodule, radupload. net2"/>
</Httpmodules>
2. Reference and declare use
Page:
<% @ Page Language = "C #" autoeventwireup = "true" codefile = "default. aspx. cs" inherits = "_ default" %>
<% @ Register Assembly = "radupload. net2" namespace = "telerik. webcontrols" tagprefix = "Radu" %>
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head runat = "server">
<Title> No title page </title>
</Head>
<Body>
<Form ID = "form1" runat = "server">
<Div>
<Radu: radprogressmanager id = "radprogressmanager1" runat = "server"/>
& Nbsp; <br/>
<Input id = "file1" runat = "server" class = "uploadbox" name = "file1" type = "file"/> <br/>
<Radu: radprogressarea id = "radprogressarea1" runat = "server">
</Radu: radprogressarea>
<Br/>
<Asp: button id = "button1" runat = "server" text = "button" onclick = "button#click"/> </div>
</Form>
</Body>
</Html>
RearCode:
Using system;
Using system. Data;
Using system. configuration;
Using system. Web;
Using system. Web. Security;
Using system. Web. UI;
Using system. Web. UI. webcontrols;
Using system. Web. UI. webcontrols. webparts;
Using system. Web. UI. htmlcontrols;
Using telerik. webcontrols;
Public partial class _ default: system. Web. UI. Page
{
Protected void page_load (Object sender, eventargs E)
{
}
Protected void button#click (Object sender, eventargs E)
{
// Generate guid
Guid id = system. guid. newguid ();
Foreach (uploadedfile up in raduploadcontext. Current. uploadedfiles)
{
String filename = up. getname ();
Int Index = filename. lastindexof (".");
String type = filename. substring (INDEX );
Up. saveas (server. mappath ("~ /Upload ") +" \ "+ id. tostring () + type, true );
}
}
}
3. File Size Control. If it is too large, a page error is reported.
Add in Web. config