Skip to main content
nikos101
Inspiring
September 26, 2008
Question

How do I save a file to a server using flex and coldfusion?

  • September 26, 2008
  • 2 replies
  • 654 views
How do I save a file to a server using flex and coldfusion?

On the CF side I might need to use this:
<cffile action="UPLOAD" filefield="Filedata" destination="#expandpath('..\somepath)#" nameconflict="overwrite">

And on the flex side I might need to use something like this:

var sendVars:URLVariables = new URLVariables();
sendVars.action = "upload";

var request:URLRequest = new URLRequest();
request.data = sendVars;
request.url = _strUploadScript;
request.method = URLRequestMethod.POST;
_refUploadFile = new FileReference();
_refUploadFile = _arrUploadFiles[_numCurrentUpload].data;
_refUploadFile.addEventListener(ProgressEvent.PROGRESS, onUploadProgress);
_refUploadFile.addEventListener(Event.COMPLETE, onUploadComplete);
_refUploadFile.addEventListener(IOErrorEvent.IO_ERROR, onUploadIoError);
_refUploadFile.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onUploadSecurityError);
_refUploadFile.upload(request, "file", false);


I just don't know how to put it all together in Coldfusion.

This topic has been closed for replies.

2 replies

nikos101
nikos101Author
Inspiring
February 20, 2009
thanks