Sandeep kumar

Sandeep kumar

  • NA
  • 58
  • 4.5k

ajaxToolkit:AsyncFileUpload

Feb 14 2021 8:58 AM
How can i do multiple file upload through ajaxToolkit:AsyncFileUpload.
 
please help me and provide code. as soon as possible.
 
Actually i am stuck in this situation.
  1. <script>  
  2. function UploadStarted(sender, args) {  
  3. //Check the filename  
  4. var filename = args.get_fileName();  
  5. var filext = filename.substring(filename.lastIndexOf(".") + 1);  
  6. if (filext == "exe" || filext == "sql" || filext == "bak" || filext == "bat") {  
  7. var err = new Error();  
  8. err.name = 'My API Input Error';  
  9. err.message = 'Cannot Upload .exe, .sql, .bak, .bat files';  
  10. throw (err);  
  11. return false;  
  12. }  
  13. else {  
  14. return true;  
  15. }  
  16. }  
  17. </script>  
  18. <div>  
  19. <div>  
  20. <ajaxToolkit:AsyncFileUpload  
  21. OnClientUploadError="uploadError"  
  22. OnClientUploadComplete="UploadComplete"  
  23. ID="dmsFile"  
  24. UploadingBackColor="HotPink"  
  25. CompleteBackColor="#FFFFCC"  
  26. OnUploadedComplete="dmsFile_UploadedComplete"  
  27. runat="server"  
  28. BorderWidth="0"  
  29. MaximumNumberOfFiles="3"  
  30. OnClientUploadStarted="UploadStarted" />  
  31. <%-- <asp:FileUpload ID="dmsFile" runat="server" multiple="multiple"/>--%>  
  32. <asp:ImageButton ID="btnCreateNew" Visible="true" SkinID="imageButtonCreate"  
  33. runat="server" OnClick="btnCreateNew_Click" />  
  34. <div id="upLoadMessage"></div>  
  35. </div>  

Attachment: SourceCode.zip

Answers (3)