我的问题是,文件上传器http://valums.com/ajax-upload/将params添加到URL中,而不是通过POST传递它们。
例如:
action:'/upload.php'
params : { x1:'x1'}..。将作为URL提交:
/upload.php?x1=x1
(收到),但是我需要通过更多的邮件。这个是可能的吗?
发布于 2011-03-11 18:39:20
我认为你使用的是ajax-上传的旧版本。我找到了这个新的。
下面是一个使用正确转换为隐藏输入字段的data属性的OK示例:http://jsfiddle.net/marcosfromero/XkCP5/
var button = $('#button1'), interval;
new AjaxUpload(button,{
//action: 'upload-test.php', // I disabled uploads in this example for security reasons
action: 'upload.htm',
--> data: {field1: 'value1', field2: 'value2'}, <--
...我停止了文件的提交,并获得了自动创建的表单:
<form enctype="multipart/form-data" method="post" style="display: none;" action="upload.htm" target="ValumsAjaxUpload0">
<input type="hidden" name="field1" value="value1">
<input type="hidden" name="field2" value="value2">
<input type="file" name="myfile" style="position: absolute; margin: -5px 0pt 0pt -175px; padding: 0pt; width: 220px; height: 30px; font-size: 14px; opacity: 0; cursor: pointer; display: block; z-index: 2147483583; top: 48px; left: 147px;">
</form>https://stackoverflow.com/questions/5144082
复制相似问题