AnsweredAssumed Answered

UploadContentServlet works, what do I do now?

Question asked by ejholmgren on Feb 10, 2009
Latest reply on Feb 16, 2009 by ejholmgren
I currently have the following ColdFusion code working, and the upload is successful returning an HTTP 200 OK response:

<cfhttp url="#APPLICATION.alfrescoRoot#/service/api/login?u=#APPLICATION.alfrescoUsername#&pw=#APPLICATION.alfrescoPassword#" method="GET"/>

<cfset myTicket = XMLParse(CFHTTP.FileContent).ticket.XmlText>

<cfhttp url="http://localhost:8080/alfresco/upload/test.pdf?ticket=#myTicket#" method="put">
   <cfhttpparam type="file" name="myFile" file="C:\test.pdf">
</cfhttp>

<cfdump var="#CFHTTP#">

The content of the response contains contentUrl=store://2009/2/10/11/51/81a3a5f2-f79b-11dd-82dd-77dded3c2072.bin|mimetype=application/pdf|size=57601|encoding=UTF-8|locale=en_US_ which I assume is the nodeRef, mimetype, size, encoding, etc … but how can I move it somewhere in the repository so it is accessible (ie. to /Company Home/Upload/)?  Logically, I need to write a webscript that either moves this node somewhere else in the repository or creates a node beforehand to stream the data into. I've written a few webscripts already, but can't figure out how to even start on this one. Any help would be greatly appreciated.

Eric

Outcomes