我有Coldfusion / Sharpoint / Excel问题(保存)

好的,我需要一些高水平的帮助或者一些有经验的帮助。

这是一个环境问题,不是特别的代码问题。 没有错误,并保存了一个文件。

我正在使用Sharepoint 2013的REST api,并“获取”一个Excel文件,并从coldfusion cffile保存,action ='write'。 由此产生的文件有两种腐败。

1,.xlsm文件扩展名改为zip不允许新的办公结构/文件工作。 第二个Excel文件不能在Excel中打开,而Excel无法修复这个损坏。

Soooo .. cffile行动readBinary存在,转储将在转储中显示一个“黄色”框并截断数据。

cffile操作'write'存在,'writebinary'不存在…

当我从Sharepoint提取数据并转储数据时,它的标准蓝色框看起来像是数据,但不会被截断,也不会像'readBinary'数据那样是“黄色”。

文档说写不需要二进制,它只是在二进制识别。

/ /修改返回的数据与这些函数没有帮助Binary()失败Binary(toBase64())的作品,但已损坏toBase64()的作品,但腐败直接保存工程,但已损坏…

从二进制标志作为REST从共享点获取不会更改损坏的结果

我试图保存在底层的Java,腐败…

在记事本++打开损坏的文件看起来像一个Excel文件也打开记事本+ +在文件的顶部。 (没有明显的数据问题)

它的奇怪,但在文件的结尾似乎有文件引用不存在的文件,如0000.dat,trash.dat等等

As the save, and the get (from sharepoint) are all 'working' and there would be too much code so I am not posting specific code. 

如果你有任何想法,没有尝试或已经解决了这个具体问题,我很想听听你的专家意见。

感谢加里

好吧,我要吃我的话,张贴代码可能是有帮助的。 我仍然有15个版本的function,它真的会令人困惑。

我原来的代码有Sharepoint的二进制部分,但不是CFHTTP部分。 答案/问题在那里,Coldfusion没有保留二进制数据。 一旦参数被添加,“转储”反映了“黄色”二进制颜色的变化。

例如:为cfhttp调用!

 getAsBinary="true" // default is NO not AUTO -> should be auto adobe 

之前:

 rc.spActionURL = "https://{site}.sharepoint.com/sites/#this.sp365.orisApp#/_api/Web/GetFileByServerRelativeUrl('/sites/#this.sp365.orisApp#/#arguments.libraryPath#/#arguments.folderName#/#arguments.fileName#')/$value"; //Perform SharePoint ODATA Query as long as access_token was successfully received. cfhttp(method="get", charset="utf-8", url="#rc.spActionURL#", result="rc.spURLRequestResult", ) { cfhttpparam(name="Accept", type="header", value="application/xml"); cfhttpparam(name="Content-Type", type="header", value="application/vnd.ms-excel.sheet.macroEnabled.12"); cfhttpparam(name="Authorization", type="header", value="#arguments.AccessToken#"); cfhttpparam(name="binaryStringRequestBody", type="header", value="true"); } ; 

后:

 rc.spActionURL = "https://{site}.sharepoint.com/sites/#this.sp365.orisApp#/_api/Web/GetFileByServerRelativeUrl('/sites/#this.sp365.orisApp#/#arguments.libraryPath#/#arguments.folderName#/#arguments.fileName#')/$value"; //Perform SharePoint ODATA Query as long as access_token was successfully received. cfhttp(method="get", getAsBinary="true" // default is NO not AUTO -> should be auto adobe charset="utf-8", url="#rc.spActionURL#", , result="rc.spURLRequestResult", ) { cfhttpparam(name="Accept", type="header", value="application/xml"); cfhttpparam(name="Content-Type", type="header", value="application/vnd.ms-excel.sheet.macroEnabled.12"); cfhttpparam(name="Authorization", type="header", value="#arguments.AccessToken#"); cfhttpparam(name="binaryStringRequestBody", type="header", value="true"); } ;