jquery – Submitting form from WP_filesystem dialog box

I am attempting to submit a form from the WP_filesystem. I realize this might be a bit substandard, but here’s what I’m trying to do.

  1. User clicks the browse button, and wp_filesystem is invoked and standard file dialog box appears.
  2. User selects file and when the open button is pressed, the file dialog box (in addition to whatever else it does), submits a form with the selected image.

This actually works quite well for the media library window using the following code:

wp.media.wpUserAvatar.frame().state('library').on('select', function() {
        jQuery("(class='name-of-form') input(type='submit')").click();

So I’m hoping there’s an equivalent for the standard wp_filesystem window.