I have called an AJAX with some post fields like this:
var postData ="gid="+gid+"&daydob=" +daydob+"&monthdob=" +monthdob;
With reference to THIS blog, for a FILE I have done something like this:
var fileId = document.getElementById("fileGS");
var file = fileId.files[0];
var formData = new FormData();
formData.append('file', file);
Finally:
postData = postData + "&fileGS=" + formData;
//Called AJAX after
Now while retrieving the parameter fileGS
, I get [object FormData]
in a PHP variable, where I am unable to access this JS object for uploading my File using PHP.
Can anyone please help me out that how can I access this object. I cannot alter much this AJAX since it is already in production(and uses YAHOO YUI
). I am only adding image uploading feature to it.