asp.net - Improving RadFileUpload to check for 250MB file size BEFORE starting Upload? -
can tell me how check file size of file selected upload before starting upload?
<telerik:radupload id="fuuploadfile" runat="server" controlobjectsvisibility="none" onclientfileselected="validationfailed" inputsize="50" targetfolder="\upload" allowedfileextensions=".wav,.mp3,.mpeg,.mpg,.wmv,.avi,.mp4" /> <telerik:radprogressarea id="radprogressarea1" runat="server" backcolor="#668b8b" tooltip="uploading " > </telerik:radprogressarea> <telerik:radprogressmanager id="radprogressmanager1" runat="server" /> <asp:customvalidator id="customvalidatoruploadfile" runat="server" display="dynamic" clientvalidationfunction="validatefile" cssclass="reditalic1" text="... error text here" />
create handler.
public void processrequest(httpcontext context) { httppostedfile = context.request.files[0]; if(up.contentlength > 2097152) // 2mb { //your logic here } }
Comments
Post a Comment