Java ColdFusion cfhttp在上传docx文件时释放元数据

Java ColdFusion cfhttp在上传docx文件时释放元数据,java,coldfusion,coldfusion-9,Java,Coldfusion,Coldfusion 9,我上传docx文件时遇到问题。在我上传并保存到服务器后,它释放了2个字节。这是我的密码 <cffunction name="akamaiUpload" access="private" output="false"> <cfargument name="filename" type="string" required="true"> <cfargument name="localpath" type="string" required="true"&

我上传docx文件时遇到问题。在我上传并保存到服务器后,它释放了2个字节。这是我的密码

<cffunction name="akamaiUpload" access="private" output="false">
    <cfargument name="filename" type="string" required="true">
    <cfargument name="localpath" type="string" required="true">

    <cftry>

        <cfhttp url="http://sample.com/#arguments.filename#" method="post">
            <cfhttpparam type="file" name="user_file" file="#arguments.localpath#" />
        </cfhttp>

    <!--- catch any error, return the error message --->
    <cfcatch type="any">
        <cfreturn #cfcatch.message#>
    </cfcatch>

    </cftry>
</cffunction>
我发现一些代码有相同的问题,并试图应用他们的解决方案,但仍然没有工作。这是代码

<cffunction name="akamaiUpload" access="private" output="false">
    <cfargument name="filename" type="string" required="true">
    <cfargument name="localpath" type="string" required="true">

    <cffile action="readbinary" file="#arguments.localpath#" variable="myfile">
        <cfset by=CreateObject("java","java.lang.String")>
        <cfset by.init(myfile, "iso-8859-1")>
        <cfset contentdivider=Hash("this is my divider for this")>

        <cfhttp method="POST" url="http://sample.com/#arguments.filename#" charset="iso-8859-1">
            <cfhttpparam type="header" name="Content-Type" value="multipart/form-data; boundary=#contentDivider#">
            <cfhttpparam type="Header" name="Accept-Encoding" value="deflate;q=0">
            <cfhttpparam type="Header" name="TE" value="deflate;q=0">
        </cfhttp>       

    <!--- returning true for successful upload --->
    <cfreturn true>
</cffunction>

这里有没有人经历过同样的问题?请分享一些建议

您如何确定它正在丢失两个2字节?如果您使用这样的工具,那么实际的cfhttppost是什么样子的呢?我只是使用charles检查文件上传到服务器之前和之后的大小。另一方面,我尝试在上传到服务器之前压缩文件,然后下载并解压,当我检查文件大小时,原始文件和下载文件之间没有差异。编辑除了二进制内容之外,Charles中的原始文章是什么样子?。我记得有一个关于cfhttp和文件的类似问题,但是。。。它添加了几个字节。对于grins,如果在文件字段之后添加一个虚拟字段,有什么区别吗?我发现一些代码有相同的问题,你能发布一个链接吗?