ActionScript 3.0:
1 2 3 4 5 6 7 8 9 | var list:FileReferenceList = new FileReferenceList(); list.addEventListener(Event.SELECT, selectHandler, false , 0 , true ); list.browse(); function selectHandler(event:Event): void { var request:URLRequest = new URLRequest( “upload.php” ); var files: Array = FileReferenceList(event.target).fileList; for ( var i: uint = 0 , l: uint = files.length; i < l; i++) FileReference(files[i]).upload(request); }; |
PHP:
1 | copy ( $_FILES [ ‘Filedata’ ][ ‘tmp_name’ ], $_FILES [ ‘Filedata’ ][ ‘name’ ]); |