[Laszlo-dev] File upload for swf9 runtime?

Raju Bitter rajubitter at me.com
Wed Feb 18 17:08:08 PST 2009


Henry,

yes, in the forums:
http://forum.openlaszlo.org/showthread.php?t=12708

<canvas height="1000" width="1000">

   <class name="as3uploader" extends="node">

	    <attribute name="fileRef" type="expression" value="null" />

	    <passthrough>
	       /* Put AS3 import statements here */
	       import flash.net.FileReference;
            import flash.events.Event;
            import flash.net.URLRequest;
	    </passthrough>
	
	   <method name="startUpload">
	    <![CDATA[
	    #passthrough  {
		   this.fileRef = new FileReference();
		   fileRef.addEventListener(Event.SELECT,this.selectHandler);
            Debug.write("Using ", this.selectHandler, " as HANDLER");
		   fileRef.browse();
	    }#
	    ]]>
	  </method>
	
	   <method name="selectHandler" args="ev=null">
	    <![CDATA[
         #passthrough  {
            /*Map this to the servlet or jsp you wish to use to handle  
your file writing request*/
		   var request:URLRequest = new URLRequest("http://localhost:8080/openlaszlo4.2/upload/fileupload/fileLoader.jsp 
");
		   fileRef.upload(request);
            Debug.write("File was selected");
            Debug.write(request.url);
	    }#
	    ]]>
	  </method>
	
   </class>


   <as3uploader id="uploader"/>

   <button text="Upload file" onclick="uploader.startUpload()" />


</canvas>

Cheers,
Raju
On Feb 18, 2009, at 7:54 PM, Henry Minsky wrote:

> Has anyone tried getting the  file upload API working in the swf9  
> 4.2 runtime?
>
>
>
> -- 
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com



More information about the Laszlo-dev mailing list