Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>after searching on net finally i have solved the issue and posting it so that if anyone had similar problem this should help</p> <pre><code> // set which files are allowed in FileUpload Control var validFilesTypes = ["bmp", "gif", "png", "jpg", "jpeg", "doc", "docx", "xls", "xlsx", "htm", "html", "rar", "zip", "txt", "pdf"]; function CheckExtension(file) { /*global document: false */ var path = file.value; var ext = path.substring(path.lastIndexOf(".") + 1, path.length).toLowerCase(); var isValidFile = false; for (var i = 0; i &lt; validFilesTypes.length; i++) { if (ext == validFilesTypes[i]) { isValidFile = true; break; } } if (!isValidFile) { alert("Invalid File. Unknown Extension Of Tender Doc" + "Valid extensions are:\n\n" + validFilesTypes.join(", ")); } return isValidFile; } function validateFileSize(file) { /*global document: false */ //getting size of the file var fileSize = file.files[0].size; var isValidFile = false; if (fileSize !== 0 &amp;&amp; fileSize &lt;= 25214400) { isValidFile = true; } if (!isValidFile) { alert("File Size Should be Greater than 0 and less than 25 mb"); } return isValidFile; } </code></pre> <p>and calling these method in FileUpload Control like that</p> <pre><code>&lt;asp:FileUpload ID="fuTenderDoc" onchange="var result=CheckExtension(this);validateFileSize(this); return result" runat="server"&gt;&lt;/asp:FileUpload&gt; &lt;asp:FileUpload ID="fuBidDoc" onchange="var result=CheckExtension(this);validateFileSize(this); return result" runat="server"&gt;&lt;/asp:FileUpload&gt; &lt;asp:FileUpload ID="fuTechnicalDoc" onchange="var result=CheckExtension(this);validateFileSize(this); return result" runat="server"&gt;&lt;/asp:FileUpload&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload