Answered
Automatically Upload client file to CF Server
I have a scenario where I need to automatically upload a
client file to CF Server without using a browser. WebDAV redirector
will not do this as I am using https. I've written a simple
ColdFusion web service to handle the file once I get it but I have
no idea how to consume this service from the client without a user
openning a browser. Here's my simple web service code...
<cfcomponent>
<cffunction name="uploadFile" access="remote" returntype="void" hint="Web Service to process secure file upload">
<cfargument name="appUserID" type="string" required="yes">
<cfargument name="appPassword" type="string" required="yes">
<cfargument name="uploadFile" type="binary" required="yes">
<cfargument name="workgroupID" type="string" required="yes">
<cfset uploadDir = #APPLICATION.defaultRootValue# & "/filestores/groups/" & #workgroupID# & "/">
<cffile action="upload" filefield="#uploadFile#" destination="#uploadDir#">
</cffunction>
</cfcomponent>
<cfcomponent>
<cffunction name="uploadFile" access="remote" returntype="void" hint="Web Service to process secure file upload">
<cfargument name="appUserID" type="string" required="yes">
<cfargument name="appPassword" type="string" required="yes">
<cfargument name="uploadFile" type="binary" required="yes">
<cfargument name="workgroupID" type="string" required="yes">
<cfset uploadDir = #APPLICATION.defaultRootValue# & "/filestores/groups/" & #workgroupID# & "/">
<cffile action="upload" filefield="#uploadFile#" destination="#uploadDir#">
</cffunction>
</cfcomponent>