filefine-uploader

how to clear the file name list after fineUploader (3.5) uploads file


I download fine uploader 3.5, created http handler for a file upload function in my little website . the website is done by asp.net ajax and jquery. it runs at IE9. every time I upload a file, there is a list of file names shown below the load button. if I don't want thme, what should I do? my code is like this: html: ...

    '<tr><td><div id="jquery-wrapped-fine-uploader"></div></td></tr>...
    'ajax/jquery:...

    '$('#jquery-wrapped-fine-uploader').fineUploader({
          'request: {  endpoint: 'xxx.ashx' }        
     '})

    '$('#jquery-wrapped-fine-uploader').on("complete", 
       'function (event, id, fileName, responseJSON)     {                
       '     alert("UPLOAD SUCCESS");
       '     $.ajax({some ajax calls here});
    ' })

// WHERE TO PUT this TO CLEAR the UPLOADED FILE LIST??? $('#jquery-wrapped-fine-uploader').fineUploader('reset'); XXX.ashx:

     '...  public void ProcessRequest (HttpContext context) {   
      'do some http request work..
      'context.Response.ContentType = "text/plain";
      'context.Response.Write("{\"success\":true}");
      '}

My question is: I want to completely remove the uploaded file list which shows automatically in green color ( or red if they fail), in order to clear them, I tried to put: $('#jquery-wrapped-fine-uploader').fineUploader('reset'); right after .on('complete'), it's not working, also #jquery-wrapped-fine-uploader seems cached all the time. please help on this.


Solution

  • If you don't want to see the file list at all, you should be using FineUploaderBasic mode instead of using FineUploader mode and then removing all elements in the pre-built UI. FineUploaderBasic mode gives you access to the API, options, and callbacks, but assumes you will be creating your own UI. In other words, FineUploaderBasic mode does not create any DOM elements (except the opaque file input element as a child of your button container, if you supply one). This is all explained (in a great amount of detail) in the documentation.

    Start here: http://docs.fineuploader.com