
The dbConfig.php file is used to connect and select the database using PHP and MySQL. ) ENGINE= InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci Database Configuration (dbConfig.php) `submitted_on` datetime NOT NULL DEFAULT current_timestamp(), `file_name` varchar( 255) COLLATE utf8_unicode_ci NOT NULL, `email` varchar( 50) COLLATE utf8_unicode_ci NOT NULL, `name` varchar( 50) COLLATE utf8_unicode_ci NOT NULL, The following SQL creates a form_data table with some basic fields in the MySQL database.


In this tutorial, we will show you the simplest way to upload files or images with form data using jQuery, Ajax, and PHP. In the earlier tutorial, we discussed an easy way to upload files using jQuery and Ajax in PHP. But if you want to provide a better user interface, jQuery and Ajax can be used to upload file without page refresh.


Generally, a form is submitted and the page is refreshed to upload file in PHP. If (typeof upload functionality is a common feature of the dynamic web application. $("form button").on("click", function (event) ) It, also, helps to upload parameters as JSON and to change the content type to application/json (my default).Ī simple form with two input text, one select and a button element. The answer of Jonathan Amend on this post helped me a lot.įor more details, the above source code is able to download a file using a JQuery Ajax request (GET, POST, PUT etc).
