我们有一个应用程序,我们在ColdFusion服务器上生成.doc文件.该文件在MSWord中正确打开并正确显示.
在Internet Explorer中,它要求我下载或保存文件.保存时,文件在我的下载文件夹中保存为file.doc,这是正确的.
直接从Internet Explorer打开时,文件正确显示.但是当我在MSWord中"保存为"时,默认文件类型是"网站"而不是"word文档".
这是单词的内容.我知道有更好的解决方案,但那就是我们如何完成它.
<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:w='urn:schemas-microsoft-com:office:word' xmlns='http://www.w3.org/TR/REC-html40'>
<head>
<title>file name goes here</title>
<!--[if gte mso 9]>
<xml>
<w:WordDocument>
<w:View>Print</w:View>
<w:Zoom>90</w:Zoom>
<w:DoNotOptimizeForBrowser/>
</w:WordDocument>
</xml>
<![endif]-->
<style>/*style goes here*/</style>
</head>
<body>body goes here</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我曾尝试添加doctype,但什么也没发生.
在ColdFusion上,发生以下情况:
<cfcontent reset="true" type="application/vnd.ms-word" />
#wordContent#
<cfheader name="Content-Disposition" value="attachment; filename=file.doc" />
Run Code Online (Sandbox Code Playgroud)
我也试过"application/msword"作为MIME-Type,但什么也没发生.
我试图把它变成一个.docx,但是它的格式错误似乎是合乎逻辑的,因为它不是xml而是html.
我希望,可能会有一些元信息,它允许我访问默认文件名,例如
<o:Author>Author name goes here</o:Author>
<o:LastAuthor>Last authors name goes here</o:LastAuthor>
<o:Revision>1</o:Revision>
<o:Created>#dateFormat(now(),"yyyy-mm-dd")#T#timeFormat(now(),"HH:mm")#Z</o:Created>
<o:LastSaved>#dateFormat(now(),"yyyy-mm-dd")#T#timeFormat(now(),"HH:mm")#Z</o:LastSaved>
<o:Version>12.00</o:Version>
</o:DocumentProperties>
Run Code Online (Sandbox Code Playgroud)
我也玩过这里给出的信息http://en.wikipedia.org/wiki/Microsoft_Office_XML_formats
但它们似乎都没有奏效.我在这里,寻求帮助.
编辑:添加了MSWord行为错误的截图(德语)

我试图通过Facebook Graph API将图像发布到相册,并遵循以下ColdFusion-Code:
<cfhttp method="post" url="https://graph.facebook.com/#albumid#/photos/">
<cfhttpparam type="formfield" name="access_token" value="#access_token#" />
<cfhttpparam type="file" name="source" file="#img_dir#\dummy.jpg" />
<cfhttpparam type="formfield" name="message" value="foo bar" />
<cfhttpparam type="formfield" name="no_story" value="true" />
</cfhttp>
Run Code Online (Sandbox Code Playgroud)
如果我省略no_story=true,整个过程完美无缺,但是我需要这个属性来阻止帖子出现在我的墙上.我收到这个错误:
{"error":{"message":"(#100) Param no_story must be a boolean","type":"OAuthException","code":100}}
HTTP/1.1 400 Bad Request Content-Type: text/javascript; charset=UTF-8 WWW-Authenticate: OAuth "Facebook Platform" "invalid_request" "(#100) Param no_story must be a boolean" Access-Control-Allow-Origin: * X-FB-Rev: 1568945 Pragma: no-cache Cache-Control: no-store Facebook-API-Version: v2.2 Expires: Sat, 01 Jan 2000 00:00:00 GMT X-FB-Debug: Vt7Viz/nlNfsQDDfNKtVuBjfgjDiWPFxYb0TAEpJJa9NjrR+TrEB8nuMOerQJYMX9E2e1CeqfBZT70/1KODErg== Date: Wed, 21 Jan …Run Code Online (Sandbox Code Playgroud) 我有以下标记:
<div class="controls">
<input type="radio" id="sex" name="sex" value="m"> Boy
<input type="radio" id="sex" name="sex" value="f"> Girl
<input type="radio" id="sex" name="sex" value="t"> Twins
</div>
Run Code Online (Sandbox Code Playgroud)
如何选择每个单选按钮及其后续文本.我的目标是将两者都包装在标签中,因此输出将是:
<div class="controls">
<label><input type="radio" id="sex" name="sex" value="m"> Boy</label>
<label><input type="radio" id="sex" name="sex" value="f"> Girl</label>
<label><input type="radio" id="sex" name="sex" value="t"> Twins</label>
</div>
Run Code Online (Sandbox Code Playgroud)
不幸的是,标记是由CMS创建的.(它也增加了id="sex"多次,blergh).