【正文】
Types:FileFilter = new FileFilter(圖片 (*.jpg, *.jpeg, *.gif,*.png), *.jpg。 (, progressHandler)。 import 。直接貼代碼吧:Flex代碼,:?xml version= encoding=utf8?s:Application xmlns:fx= xmlns:s=library:// xmlns:mx=library:// minWidth=955 minHeight=600 creationComplete=init()。這里只是一個簡單的例子,供大家入門用哈。該上傳對象會根據(jù)request來解析文件,生成一個ListFileItem,在就是對該List進行循環(huán)處理,通過List中對象的write方法將數(shù)據(jù)寫入磁盤。flex中的請求交由服務器中的servlet處理,在提交的URL中需要包括servlet名。再根據(jù)這個工廠對象創(chuàng)建一個上傳對象。The simplest usage scenario of uploading is the following:1. Uploaded items should be retained in memory as long as they are reasonably small.2. Larger items should be written to a temporary file on disk.3. Very large upload requests should not be permitted.4. The builtin defaults for the maximum size of an item to be retained in memory, the maximum permitted size of an upload request, and the location of temporary files are acceptable.Flex負責前臺界面,Java則負責前臺傳遞過來的請求(即文件上傳請求)。然后在MyEclipse中配置Build Path,將這兩個包包含進去。 import 。 private function init():void{ (*)。 (ioError, ioerrorHandler)。 *.png)。 *.xls)。 }catch (error:Error){ (無法瀏覽文件:+())。 } private function progressHandler(event:Progr