惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog
The Register - Security
The Register - Security
Stack Overflow Blog
Stack Overflow Blog
博客园 - 三生石上(FineUI控件)
T
Threat Research - Cisco Blogs
S
SegmentFault 最新的问题
V2EX - 技术
V2EX - 技术
Hacker News: Ask HN
Hacker News: Ask HN
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
P
Proofpoint News Feed
J
Java Code Geeks
Microsoft Security Blog
Microsoft Security Blog
M
MIT News - Artificial intelligence
AI
AI
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
Hacker News - Newest:
Hacker News - Newest: "LLM"
B
Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
Google DeepMind News
Google DeepMind News
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
C
Cybersecurity and Infrastructure Security Agency CISA
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
U
Unit 42
腾讯CDC
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Cloudflare Blog
H
Help Net Security
Recent Announcements
Recent Announcements
P
Privacy & Cybersecurity Law Blog
IT之家
IT之家
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Security Archives - TechRepublic
Security Archives - TechRepublic
L
LINUX DO - 热门话题
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
H
Heimdal Security Blog
博客园 - 聂微东
S
Securelist
大猫的无限游戏
大猫的无限游戏
Cloudbric
Cloudbric
Cisco Talos Blog
Cisco Talos Blog

博客园 - 畅想自由

为什么19.9变成了19.89,不靠谱的 double 类型 HashTable Thinking in Java HTML已经过时了 编写高质量的.NET程序 - 开篇 Do not make joke with me 告别.NET 使用Replace方法时要注意的问题 - 畅想自由 - 博客园 Tomcat 部署问题记录 最近在看的书 经济危机,让我们更加清醒 早上醒来,突然睡不着 不再技术崇拜,精神开始焕发 Vs2003中Grid绑定强类型的问题 青春的岁月我们身不由己,只因着心中燃烧着梦想... 职业规划是什么? 做一个专业的IT管理人才必备的十大能力 Delphi的类与继承 Delphi 与 C#
IE和FireFox 对动态FORM enctype属性的认识问题 - 畅想自由
畅想自由 · 2008-10-13 · via 博客园 - 畅想自由

 IE和FireFox 对FORM enctype属性的认识存在差异,一般来说对于动态创建的form,如果因为要上传文件的原因很自然的会使用类似如下的代码:  

Code

这段代码表面上看没有什么问题,但在IE中却还是无法改变FORM的编码格式,

也就是说传到服务端的ContentType仍然是:"application/x-www-form-urlencoded”.

但在FireFox中却能正确识别,也就能正常上传文件。

那如何才能使IE和FireFox都能正确按照我们的要求编码FORM 数据呢?找了N久终于找到了解决方案,就是直接指定encoding就行了,且看如下正确的代码:

Code

希望对遇到类似问题的朋友有所帮助! (注:代码中滤去了上下文代码。)