ASP.NET 3.5 and above only

Obout.Ajax.UI Controls - File Upload -Limited number of files

Here you can upload up to 10 MB of any files, but not more than two files.
Client-side filesPicked event is used.




ASP.NET
<%@ Register Assembly="Obout.Ajax.UI" Namespace="Obout.Ajax.UI.FileUpload" TagPrefix="obout" %>
<script type="text/JavaScript">
function onClientBeforeUpload(sender, args) {
   $get("<%= label.ClientID %>").innerHTML = ""
   return true;
}
function onClientFilesPicked(sender, args) {
  if (args.get_files().length > 2) {
      alert("Too many files selected: " + args.get_files().length);
      args.set_cancel(true);
  }
}
</script>
...
<asp:UpdatePanel runat="server" ID="UpdatePanel1"><ContentTemplate>
<obout:FileUpload OnClientBeforeUpload="onClientBeforeUpload"
       MaximumTotalFileSize="10240" OnClientFilesPicked="onClientFilesPicked"
       Width="250px" runat="server" id="fileUpload1"
/>
<br /><asp:Button runat="server" ID="submit" Text="Upload files" /><br /><br />
<asp:Label runat="server" ID="label" Text="" />
</ContentTemplate></asp:UpdatePanel>

"I am very very impressed, happy, satisfied and grateful. Again you have my sincere thanks!"

Cary Abramoff
The Bank of New York Mellon

Random testimonial   All testimonials