As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
public function upload (content:ByteArray):void { var url:String = "http://localhost:8080/alfresco/service/xpression/uploadNew"; var myByteArray:ByteArray = content; var request:URLRequest = new URLRequest(url); request.method = URLRequestMethod.POST; request.data = myByteArray; var loader:URLLoader = new URLLoader(); loader.load(request) }
var variables:URLVariables = new URLVariables(); loader.dataFormat = URLLoaderDataFormat.VARIABLES; variables.bytearray = myByteArray; request.data = variables;
for each (field in formdata.fields) { switch (String(field.name).toLowerCase()) { case 'bytearray': content = field.value; break;
upload.properties.content.write(content);
public function upload(content:ByteArray):void { var url:String = "http://localhost:8080/alfresco/service/xpression/uploadNew"; var myByteArray:ByteArray = content; var loader:URLLoader = new URLLoader(); loader.dataFormat = URLLoaderDataFormat.VARIABLES; var request:URLRequest = new URLRequest(url); request.method = URLRequestMethod.POST; var variables:URLVariables = new URLVariables(); variables.bytearray = myByteArray; variables.name = 'name.zip' variables.path = '/Company Home/temp/' variables.mimetype = "text/plain" variables.type = "cm:content" request.data = variables; loader.load(request) }
import ru.inspirit.net.*; public function upload(content:ByteArray, path:String, mtype:String):void { var ml:MultipartURLLoader = new MultipartURLLoader(); ml.addEventListener(Event.COMPLETE, onReady); // simple string data ml.addVariable('path', path); var currentfilename:String = 'filename.acp' ml.addFile(content, currentfilename, 'file', mtype); ml.load('http://localhost:8080/alfresco/service/xpression/uploadNew'); } public function onReady(e:Event):void { // Upload Complete }