locked
Clear File list from Ajax File Upload RRS feed

  • Question

  • User-1633484420 posted

    By any chance, does anyone have any idea how I could clear the file list from the AjaxFileUpload control?

    I haven't had any luck clearing it from the code behind and my only luck was hidding the div using jQuery. I probably should add that the control is inside an Update Pannel which is inside a modal popup extender.

    Wednesday, September 19, 2012 4:22 PM

All replies

  • User1289186222 posted

    I'm guessing you can't just set the value of the file upload to "".

    So maybe you can wrap the file upload inside a form and then do a form.reset() in javascript

    Wednesday, September 19, 2012 5:34 PM
  • User555306248 posted

    Refer this

    http://forums.asp.net/t/1477043.aspx

    Wednesday, September 19, 2012 11:52 PM
  • User-1633484420 posted

    I'm not talking about the ASyncFileUpload http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AsyncFileUpload/AsyncFileUpload.aspx Control, im talking about the AjaxFileUpload http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AjaxFileUpload/AjaxFileUpload.aspx Control which was released this year.

    The new control doesn't use inputs and therefore the linked solution doesn't work. (yes I tried making a few modifications to it but still without success.)

    Thursday, September 20, 2012 9:07 AM
  • User1384103110 posted

    I know it too late 

    but I am replying because this might help somebody one day 

    use theis line of code 

    $(".ajax__fileupload_queueContainer").empty();

    Example 

    <script>

          function emptyMyAjaxFileUpload(){

                $(".ajax__fileupload_queueContainer").empty();

          }

    </script>

    <asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server" Width="450px" MaximumNumberOfFiles="1"
    AllowedFileTypes="png,jpg,jpeg,gif" OnClientUploadCompleteAll="emptyMyAjaxFileUpload" />

    Sunday, December 8, 2013 11:24 AM
  • User573118629 posted

    Yes, it did help.

    Many thanks for the info :)

    Thursday, June 18, 2015 3:30 AM