How to bind to plupload events for file Upload field

Support General How to bind to plupload events for file Upload field

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #33652
    MalakMalak
    Participant

    Hi There!

    I have a metabox file upload field which has a problem that if you submit the form while the files are being uploaded, it does not wait for the file upload to be finished, and we end up saving the post without files getting saved.

    What I have figured is that if we disable the submit button while the files are being uploaded, then this situation can be taken care of. Until now, I have figured that plupload library is being used by metabox for file upload.

    However, when I try to bind the FileUploaded event using this code:

    
    plupload.Uploader.bind("FileUploaded", function(up,files){
      console.log("file uploaded");
    
    });
    

    this event does not fire at all. Could you please point me in the right direction on how can I correctly bind the events to the file upload field. Or how can I disable the form submit while the files are being uploaded.

    Any help appreciated, thanks!

    #33706
    Long NguyenLong Nguyen
    Moderator

    Hi Malak,

    Thanks for your feedback.

    I will inform the development team to fix this issue in future updates. For now, I think you can use the JS code to check the class rwmb-media-list, if it has the child class rwmb-file, then enable the submit button. If not, just disable the submit button.
    Screenshot https://monosnap.com/file/VTKLaiip6oeCd3n29Wl2IH38rHvH6g

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.