使用SWFUpload v2.2,Firefox 3,IE 8,Flash 10 在我的ASP.NET应用程序中,所有上传都由upload.aspx处理(我有正确的upload_url设置为设置对象)。在IE 8中,上传到upload.aspx页面并进行处理,但在Firefox中却没有。有什么建议么?SWFUpload适用于IE浏览器,但不适用于Firefox
最让用户访问上传的文件,这里显示的页面的代码(注意:正在使用的母版页):
<script type="text/javascript" src="../swfupload/swfupload.js"></script>
<script type="text/javascript" src="../js/handlers.js"></script>
<script type="text/javascript">
var swfu;
window.onload = function() {
swfu = new SWFUpload({
// Backend Settings
upload_url: "../upload.aspx",
post_params: {
"ASPSESSID": "<%=Session.SessionID %>"
},
// File Upload Settings
file_size_limit: "10 MB",
file_types: "*.*",
file_types_description: "All Files",
file_upload_limit: 1,
file_queue_limit: 1,
//assume_success_timeout: 60,
// Event Handler Settings - these functions as defined in Handlers.js
// The handlers are not part of SWFUpload but are part of my website and control how
// my website reacts to the SWFUpload events.
file_queue_error_handler: fileQueueError,
file_dialog_complete_handler: fileDialogComplete,
upload_progress_handler: uploadProgress,
upload_error_handler: uploadError,
upload_success_handler: uploadSuccess,
upload_complete_handler: uploadComplete,
// Button settings
button_image_url: "../Images/XPButtonNoText_160x22.png",
button_placeholder_id: "spanButtonPlaceholder",
button_width: 160,
button_height: 22,
button_text: '<span class="button">Upload File<span class="buttonSmall">(10 MB Max)</span></span>',
button_text_style: '.button { font-family: Helvetica, Arial, sans-serif; font-size: 14pt; } .buttonSmall { font-size: 10pt; }',
button_text_top_padding: 1,
button_text_left_padding: 5,
// Flash Settings
flash_url: "../swfupload/swfupload.swf", // Relative to this file
custom_settings: {
upload_target: "divFileProgressContainer"
},
// Debug Settings
debug: false
});
}
</script>
查尔斯是一个很好的建议!使用Charles我能够确认没有任何内容被发送到服务器(所有请求都是GET)。现在我仍然试图找出原因!另外,查尔斯也没有IE的流量出现,所以我很难搞清楚POST的成功。查尔斯应该自动配置IE浏览器,它似乎是,但没有流量显示。 – Xolamee 2010-02-11 22:37:43
IE和Firefox代理的工作方式不同。从我记得的地方,你必须专门打开IE浏览器的Windows代理服务器,如果你在本地开发,你需要关闭IE浏览器某处的设置,以“绕过本地主机代理”。 – 2010-02-11 22:46:17
我刚刚意识到这是IE 7的一个已知问题,并且通过“http:// computername”而不是“http:// localhost”访问我的网站可以修复此行为。对IE和Firefox的运行扫描显示,它们都经历了完全相同的GET序列,但在Firefox中没有post.aspx文件,而在IE中有。谢谢你继续帮助我与这个山姆。有什么线索可以找到,这将暗示为什么Firefox不POST? – Xolamee 2010-02-11 23:06:25