【问题标题】:Upload google docs with coldfusion使用coldfusion上传谷歌文档
【发布时间】:2013-01-03 06:44:27
【问题描述】:

我在 ColdFusion 中构建了一个类似论坛的应用程序,我想添加一个功能,用户可以使用其 Google 帐户将文件上传到 Google Docs,然后其他用户可以编辑这些文件。

我一直在使用这个 CFC:http://cfgoogle.riaforge.org/ 来检索 Google 文档,但目前缺少上传功能。我需要上传功能来首次上传文件,然后再进行第二部分的编辑。我希望这是有道理的。

这就是我寻求帮助的原因。我对 cffunctions 没有那么丰富的经验,我想知道是否有人可以帮助我。

这是我目前所拥有的:

<cffunction name="upload" access="public" returnType="any" hint="I upload the document." output="false">
<cfargument name="myFile" type="string" required="true" hint="file to upload.">

<cfset var result = "">
<cfset var service = variables.docservice>

<cfset theUrl = "https://docs.google.com/feeds/documents/private/full HTTP/1.1">

<cfhttp url="#theURL#" method="post" result="result">
<cfhttpparam type="header" name="Authorization" value="GoogleLogin auth=#getAuth(service)#">
<cfhttpparam type="header" name="Content-Length" value="81047">
<cfhttpparam type="header" name="Content-Type" value="application/msword">
<cfhttpparam type="header" name="Slug" value="#myFile#">
</cfhttp>

<cfreturn result.filecontent>

</cffunction>

但是当我输出结果时出现以下错误: '无效的请求 URI'

如果有人能帮我解决这个问题(甚至只是给我指路),我将不胜感激。

【问题讨论】:

    标签: coldfusion google-docs cfc


    【解决方案1】:

    我会尝试用upload 方法扩展cfgoogle CFC,使用Protocol Guide 进行上传。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-11
      相关资源
      最近更新 更多