iPhone Ajex multipart boundary charset
来源:互联网 发布:淘宝发顺丰快吗 编辑:程序博客网 时间:2024/05/22 02:03
Prototype messes up the multipart boundary
原文:https://prototype.lighthouseapp.com/projects/8886/tickets/498-prototype-messes-up-the-multipart-boundary
Reported by Gabriel Aubut-Lussier | December 19th, 2008 @ 07:21 PM
When preparing a multipart/form-data POST withthe 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 />";
} ?>
- 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 说明
- multipart form-data boundary 说明
- 上传文件multipart form-data boundary 说明
- Prototype messes up the multipart boundary
- (转)multipart form-data boundary 说明
- (转)multipart form-data boundary 说明
- (转)multipart form-data boundary 说明
- boundary
- 如何确定Oracle数据库表中重复的记录
- 高级Linux程序设计第二章:编写良好的Linux软件
- 堆栈与函数调用
- 笔记本CPU(Intel)
- 在CSDN第一篇日志
- iPhone Ajex multipart boundary charset
- 努力!
- js里把字符串转换成json对象
- OpenGL ES Programming Guide for iPhone OS (As a 学习大纲)
- 传智播客java培训2010年4月24日hibernate学习
- Extjs关于GridView排序问题
- postfix简要安装
- 意外
- postfix日志分析工具