Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Forms 表单提交后未获取文件名_Forms - Fatal编程技术网

Forms 表单提交后未获取文件名

Forms 表单提交后未获取文件名,forms,Forms,我正在尝试提交一个动态生成的表单。 表单提交后,我从表单获取所有值,除了一个元素是file元素。 甚至我的表单enctype也是多部分/表单数据 我用HTTPfox进行了检查,它显示在下面 Content-Disposition: form-data; name="upfile1"; filename="" Content-Type: application/octet-stream 我不明白这里发生了什么 var str_new='<form id="uploader'+

我正在尝试提交一个动态生成的表单。 表单提交后,我从
表单
获取所有值,除了一个元素是file元素。 甚至我的表单enctype也是
多部分/表单数据

我用
HTTPfox
进行了检查,它显示在下面

Content-Disposition: form-data; name="upfile1"; filename=""
Content-Type: application/octet-stream
我不明白这里发生了什么

       var str_new='<form id="uploader'+count+'" action="testkal.php" name="frmattach_kal" class="uploader" method="post" enctype="multipart/form-data" target="upload_target'+count+'"><div id="upload_progress_form'+count+'" style="clear:both">&nbsp;</div>';
       str_new +='<div class="upload_form" id="f'+count+'_upload_form"><div class="attch rmailsprite"></div><div class="upld" id="upld"><div id="upl'+count+'" class="zin2" style="width:62px;overflow:hidden;cursor:pointer;float:left;position:absolute;filter: alpha(opacity=0);"><input id="myfile'+count+'" name="upfile1" type="file" class="fileclass" size="30" onchange="javascript:upload_form_attachment('+count+');" /><input type=hidden name="FormName" value="attach" /><input type=hidden name="output" value="xml" /><input type=hidden name="sid" value="5" /></div>';
        str_new +='<div class="cornLeftTop" style="float:left;"><a id="anch'+count+'" style="text-decoration: underline;" href="javascript:void(0);" onclick="javascript:test_fn('+count+');">Select file</a><span class="greyI" id="upld_inst'+count+'">(This file will start attaching once the previous file is done)</span></div>';
        str_new +='</div><div class="adjustdiv"></div></form><iframe id="upload_target'+count+'" name="upload_target'+count+'" class="upload_target" src=""></iframe>';
        document.getElementById("uploadstate").innerHTML=str_new;
var str_new='';
stru_new+='';
str_new+='(完成上一个文件后,此文件将开始附加)';
stru_new+='';
document.getElementById(“uploadstate”).innerHTML=str\u new;
这就是我生成表单的方式。它在文件元素的更改事件中被提交。 document.getElementById(“uploader”+count).setAttribute(“enctype”、“多部分/表单数据”); document.getElementById(“uploader”+count).setAttribute(“编码”、“多部分/表单数据”)


我还在这里设置enctype

您在使用提交表单的过程中做了什么?如果您发布导致提交的整个代码,它会非常有用。我正在通过ajax上传文件。我正在通过javascript提交表单。我现在用代码更新了问题