I haven’t tried but i think you need to add FormData
object directly as data
parameter. Something like this
var ajaxData = new FormData();
ajaxData.append( 'action', 'ajax_handler_import' );
ajaxData.append( '_ajax_nonce', importNonce );
// or maybe skip the nonce for now
jQuery.each($('#fileImportData')[0].files, function(i, file) {
ajaxData.append('file-'+i, file);
});
The rest of your code goes as it is
Related Posts:
- WordPress Ajax always returns a 404 error
- Click loads template via ajax
- Display notification only once
- Access/update database with jQuery
- How to display something in a div when the user clicks on a text in another div – no page refresh [closed]
- How to speed up admin-ajax.php in wordpress
- Colorbox ajax loading of outside HTML content works perfect on localhost but not on server
- Sending jsPDF documents to the server
- Ajax return code 400
- How to test nonce with AJAX – Plugin development
- class click counter save number
- AJAX request status 200 but no actual “response”
- Image upload via FormData API and AJAX is not working ($_FILES always empty)
- Save Search System
- dynamic dependent select dropdown
- How to add a do_action on refreshing of WP customizer?
- Setting value of session with Ajax not working
- How to add a Custom Mailchimp AJAX Newsletter Subscribe Form
- Fancybox type popup window that’s not an iframe
- WordPress Ajax Call inserting data but success response false
- Why i can’t get custom fields value or post ID via Ajax?
- Get uploaded image and attach it to the new post
- Accessing an API with jQuery and AJAX
- Change Query Arguments (filter) with jQuery/Ajax or PHP?
- WordPress cascading dropdown selection search based on Parent Page & Child Page
- Tracking Visitor LatLng with WordPress using JS, PHP. How to put data which was extract using JS into DB
- Admin-ajax.php 404 error
- How to pass values from one function to the other using an array variable
- How to use wp_ajax_set_post_thumbnail?
- Update $wpdb query with AJAX
- AJAX to add to cart multiple products woocommerce
- Cannot successfully execute AJAX script to call function.php specific function. Using XAMPP localhost to test
- How to echo a PHP code into WooCommerce variation product?
- How can i get the same ajax result using WP REST API instead of admin-ajax?
- How to call a function from functions.php with ajax?
- number of posts with “Load More”
- Find the method which AJAX GET calls
- Why I’m Not Having Access to “$_POST” Data Outside My AJAX Callback?
- 500 (Internal Server Error) of external php file
- Dynamic Gallery
- Pass a PHP variable (loop-audio.php) to jQuery function (js/script.js)
- notify users when changed database
- Upload multiple files via ajax from an HTML file input
- get_post_meta returns on side but it doesn’t return on bottom of admin page
- Retrieve POST data from AJAX call
- JqueryUi Dialog giving Uncaught TypeError: this._addClass is not a function error
- Create Image Uploader for Widget
- problem with ajax and the path to the php page
- How to use wp_localize_script in a WordPress page other than functions.php?
- Ajax template: how to handle head section
- Is there a reason why my wordpress PHP page isn’t loading into my PHP template
- How to resize image on client-side before upload?
- Audio Player not loading when the content is loaded through Ajax, MediaElement.js no applied
- Update WordPress Custom Field with AJAX on cached page
- Targeting single page with JS
- How to retrieve the content (with a specific ID) via ajax by clicking a link tag
- Returning a value from a PHP page
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- js file in root loading without
- Why is $_REQUEST an empty array in admin-ajax.php?
- Checking for new message using AJAX and PHP. Server overload?
- Change “add to cart” button color based on Woocommerce product category [closed]
- Ajax request returns ‘Array’. How to output the actual results?
- Ajax load more button for comments wordpress
- Show success or error messages in Ajax response to WordPress custom registration form
- Can I use a jQuery Ajax request in Code Snippets Plugin for WordPress?
- HTML escaping data with ajax requests
- load ajax using admin-ajax.php
- wordpress add_action() issue in ajax call
- Function won’t run onclick using Ajax
- Get related product based on subcategory selected from category id with ID 142
- jQuery Ajax PHP function call returning [object Object]
- Execute Jquery when a specific page in my plugin is loading
- How to load previous or next attachment with jquery ?
- Some problems in custom widget
- Validating an email input from form field before submit using JQuery, AJAX, and PHP
- Hook on file upload
- Using Ajax to submit a form, and run a SQL Select query based on user input from the form
- WordPress Search Ajax + Isotope + InfiniteScroll
- duplicate posts with ajax load more wordpress
- Failed to load resource: the server responded with a status of 500 (Internal Server Error) through wp_admin_ajax.php
- How to call my PHP function with AJAX ? wp_query
- Ajax filter with loadmore button
- $.ajax results in 403 forbidden
- WordPress ajax filter returning all posts when it should be filtering by category
- WordPress load javascript file if something… (after the page is loaded)
- ACF + WP + Slick Slider Repeater Slide Group PHP not Displaying [closed]
- AJAX Filter WHILE Loop not working WordPress
- Default Image not showing up in Customizer for WP_Customize_Cropped_Image_Control
- How to create a radio button to alt between settings in wp_options table
- WordPress AJAX load post metadata in modal
- How can I correctly POST to a WordPress page?
- Adding instant search to wordpress page
- Load php function with AJAX on modal window
- Edit Image/Image Details – Replace button missing
- JSON Object Value Show Undefine
- Adding jquery using php function
- How to hide .js files on wordpress website using php or wp plugins or any? [closed]
- getJSON response to PHP
- WooCommerce Modal Fly cart on add to cart – With AJAX