Prototype messes up the multipart boundary
来源:互联网 发布:财务报表主要数据分析 编辑:程序博客网 时间:2024/06/08 02:03
原文地址:https://prototype.lighthouseapp.com/projects/8886/tickets/498-prototype-messes-up-the-multipart-boundary
Prototype messes up the multipart boundary
Reported by Gabriel Aubut-Lussier | December 19th, 2008 @ 07:21 PM
When preparing a multipart/form-data POST with the Ajax.Request class, prototype messes up the boundary by appending '; charset=' whatever the charset is set to (defaults to utf-8). See Example 1.
In order to fix this, one has to manually set the charset inside the content-type and then disable the charset. See Example 2.
Example 1 (doesn't work) :
new Ajax.Request("http://myTestSite.com/test.php", { method: 'post', contentType: 'multipart/form-data; boundary=AaB03x', postBody: '--AaB03x/r/nContent-Disposition: form-data; name=/"test/"/r/n/r/ntest/r/n--AaB03x--/r/n', onSuccess: function(transport) { alert(transport.responseText); }, onFailure: function(transport) { alert('failure'); }});
Example 2 (works) :
new Ajax.Request("http://myTestSite.com/test.php", { method: 'post', contentType: 'multipart/form-data; charset=UTF-8; boundary=AaB03x', encoding: '', postBody: '--AaB03x/r/nContent-Disposition: form-data; name=/"test/"/r/n/r/ntest/r/n--AaB03x--/r/n', onSuccess: function(transport) { alert(transport.responseText); }, onFailure: function(transport) { alert('failure'); }});
Here is the test.php script:
<?php foreach($_POST as $key => $val) {
echo $key . ": " . $val . "<BR />";
} ?>
- Prototype messes up the multipart boundary
- multipart form-data boundary 说明
- iPhone Ajex multipart boundary charset
- multipart form-data boundary 说明
- multipart form-data boundary 说明
- multipart form-data boundary 说明
- multipart form-data boundary 说明
- multipart form-data boundary 说明
- multipart form-data boundary 说明
- multipart form-data boundary 说明
- multipart form-data boundary 说明
- multipart form-data boundary 说明
- multipart form-data boundary 说明
- the request was rejected because no multipart boundary was found??求解
- XHR异步上传文件报错: “the request was rejected because no multipart boundary was found”
- 上传文件multipart form-data boundary 说明
- (转)multipart form-data boundary 说明
- (转)multipart form-data boundary 说明
- HDU 1527
- GPIO(led灯)驱动和测试程序
- 精巧的代码(待续)
- javamail例子
- 关于TWS 中一个JOB 对多个文件的CHECK!
- Prototype messes up the multipart boundary
- bluetooth 外围设备 驱动有问题 解决办法
- 如何修改MYSQL数据库密码
- dreamwear 电子书
- dom4j读取xml文件例子
- Vs2008水晶报表发布平台配置
- 造成VSS无法连接问题处理
- 使用HQL的select查询字段并构造出类
- POJ1861 Network