dongqin6926 2015-10-12 06:39
浏览 105

无法访问存储在PHP变量中的[object FormData]

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.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 个人网站被恶意大量访问,怎么办
    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 Centos / PETGEM
    • ¥15 划分vlan后不通了
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)
    • ¥15 自适应 AR 模型 参数估计Matlab程序
    • ¥100 角动量包络面如何用MATLAB绘制
    • ¥15 merge函数占用内存过大