How to upload file using jquery ajax() method?

Here i tried using below codes but it didn’t save file name in database but other text fields are my doubt is how to store file using jquery ajax() method.

var filename = $("#file").val();
type: "POST",
url: "save.php",
success: function() {
return false;

You should probably use a FormData object to accomplish this; Mozilla have a demonstration page here

The easiest and most cross-browser friendly method is to use an iframe as proxy.

Searching the query below in Google should yield some examples of implementations.

“using iframe to upload file with ajax”