File upload is not possible through AJAX.
You can upload file, without refreshing page by using IFrame
.
You can check further details here.
UPDATE
With XHR2, File upload through AJAX is supported. E.g. through FormData
object, but unfortunately it is not supported by all/old browsers.
FormData
support starts from following desktop browsers versions.
- IE 10+
- Firefox 4.0+
- Chrome 7+
- Safari 5+
- Opera 12+
For more detail, see MDN link.
Related Posts:
- Access Control Request Headers, is added to header in AJAX request with jQuery
- jQuery Ajax POST example with PHP
- Cross-Origin Read Blocking (CORB)
- syntax error: unexpected token <
- Infinite Scrolling in Asp.Net MVC with jQuery / AJAX Issues
- ajax jquery simple get request
- jQuery get textarea text
- jQuery AJAX cross domain
- Send POST data using XMLHttpRequest
- Set timeout for ajax (jQuery)
- How to generate a simple popup using jQuery
- What does on() in JavaScript do?
- jQuery AJAX submit form
- How can I upload files asynchronously with jQuery?
- Adding images to a Bootstrap Carousel with AJAX
- AJAX response error: net::ERR_EMPTY_RESPONSE
- Refresh/reload the content in Div using jquery/ajax
- SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
- How to manage a redirect request after a jQuery Ajax call
- FormData append not working
- Uncaught TypeError: Cannot read property ‘toLowerCase’ of undefined
- Download a file by jQuery.Ajax
- Ajax success function
- AJAX not Working with php as supposed
- How to change CSS using jQuery?
- How to properly use jsPDF library
- Uncaught ReferenceError: $ is not defined?
- jQuery document.createElement equivalent?
- Pure JavaScript equivalent of jQuery’s $.ready() – how to call a function when the page/DOM is ready for it [duplicate]
- How can I scroll to an element using jQuery?
- jQuery Get Selected Option From Dropdown
- Setting “checked” for a checkbox with jQuery
- Jquery : Refresh/Reload the page on clicking a button
- Export html table data to Excel using JavaScript / JQuery is not working properly in chrome browser
- How do I format date in jQuery datetimepicker?
- How to use npm jquery module?
- Jquery swipe left or right on mobile
- How to move an element into another element?
- bootstrap-datetimepicker for bootstrap 4
- Proper way to wait for one function to finish before continuing?
- How do I get an element to scroll into view, using jQuery?
- How do I check if string contains substring? [duplicate]
- explode string in jquery
- document.getElementsByClassName().innerHTML always returns “undefined”
- jQuery: Check if div with certain class name exists
- Why is this jQuery click function not working?
- How to uncheck a radio button?
- Phone mask with jQuery and Masked Input Plugin
- JQuery get all elements by class name
- Attaching ‘onclick’ event to D3 chart background
- The preferred way of creating a new element with jQuery
- What is jQuery Unobtrusive Validation?
- CreateElement with id?
- Set value of hidden input with jquery
- How does AJAX work?
- Creating a div element in jQuery
- Get class list for element with jQuery
- Convert array to JSON
- How to disable scrolling temporarily?
- How do you remove all the options of a select box and then add one option and select it with jQuery?
- Add and remove multiple classes in jQuery
- jQuery: Get selected element tag name
- Why is jquery show() not working in example
- How can I use jQuery to run MySQL queries?
- Print a div content using Jquery
- How can JavaScript save to a local file?
- How to find if div with specific id exists in jQuery?
- TypeError: $ is not a function WordPress
- Fully responsive HTML5 video
- HTML anchor link – href and onclick both?
- How can I know which radio button is selected via jQuery?
- jquery toggleClass not working
- JQuery Number Formatting
- How to add jQuery in JS file
- Get query string parameters url values with jQuery / Javascript (querystring)
- Turn jQuery.ajax() request into XMLHttpRequest (vanilla JavaScript)
- class click counter save number
- WooCommerce Ajax Cart Update Stopped Working
- is_page_template() written in jquery/javascript
- Cannot use characters ” in jQuery script in WordPress
- Ajax Validation for reCaptcha
- On click load iframe [closed]
- AJAX Success Function using JS substr() fails in WP 4.1 vs 4.0
- Using jQuery .after inside loop
- Ajax page load in wordpress the right way?
- Jquery POST Ajax Return null data in wordpress
- Script only works on wordpress home page & only when Jqurery is aded using
- internal anchor links no longer working after upgrade
- Ajax Call not Working in Plugin
- Error on clicking ‘Screen Options’ tab only at Products-related editor screen(s) and for specific user
- WordPress live search and filter
- Update $wpdb query with AJAX
- Select parent from child class name then add another class name to the parent
- AJAX to add to cart multiple products woocommerce
- Download doccument on server rather than clients browser
- How can i get the same ajax result using WP REST API instead of admin-ajax?
- Filterable posts using categories
- Why I’m Not Having Access to “$_POST” Data Outside My AJAX Callback?
- notify users when changed database
- Access jQuery tabs from primary menu while adding/removing class on tab container elements (accessing diff. tabs/tab content via primary menu items)