﻿# 升級到 Flash Player 10 將會造成無法使用Flash檔案上傳功能

雖然 Flash Player 10 的出現又多了一堆又酷、又炫的功能，不過因為一些「安全」的議題，導致 Adobe 將 Flash Player 10 中的 [FileReference](https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference.html) 這個類別做了一些改變，而這個類別中有個 [FileReference.browse()](https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference.html#browse\(\)) 方法，可以開啟一個檔案瀏覽的視窗，用來讀取使用者端本機的檔案，最常用這個功能的應用就是「檔案上傳」功能了。在 Flash Player 9 以前，使用者個方法是沒問題的，但是到了 Flash Player 10 又更嚴格的要求 [FileReference.browse()](https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference.html#browse\(\)) 方法的使用方式，不能透過 JavaScript 直接呼叫了，而改成一定要是由「人」點選時「直接呼叫 [FileReference.browse()](https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference.html#browse\(\)) 方法才能使用」，這導致網路上最常見的幾套 Flash 上傳元件全軍覆沒！

我在 [介紹幾套好用的檔案上傳元件](/post/2008/02/25/Introduce-FileUpload-Component-using-JavaScript-Flash-IFRAME) 文章中就有介紹過幾套好用的檔案上傳元件，而網路上最常見、也功能最強大的，莫過於使用 JavaScript + Flash 所開發出來的元件，我們最常用的就是 [SWFUpload](http://www.swfupload.org/) 元件了，到目前為止還處於無解的狀態。而像是 [WordPress](http://wordpress.org) 這樣知名的 Blog 系統中也使用了 [SWFUpload](http://www.swfupload.org/) 元件，同樣遭受池魚之殃。另外像是 [Flickr](http://flickr.com) 這樣知名的大站也都是緊急修改檔案上傳的介面，原本很好用的 Flash 檔案上傳機制現在都不能用了！

目前 [SWFUpload](http://www.swfupload.org/) 似乎尚未解決此問題，但 [FancyUpload](https://github.com/digitarald/digitarald-fancyupload) 好像已經解決了（參考 [FancyUpload for Flash 10](https://github.com/digitarald/digitarald-fancyupload) 頁面），其他的就要看各家套件的更新速度了。

今天是因為有客戶跟我說他們有同事沒辦法在網站後台使用檔案上傳功能，才讓我發現這個問題的，去查詢了一下國外的資料發現這問題已經存在好幾個月了，而且公幹的人非常多（見**相關連結**中部分文章的評論留言），大部分人都建議先暫時將 Flash Player 10 移除，否則這問題短時間內應該是無解。

不知道這次 Adobe 為了「安全性」而犧牲「相容性」算不算是正確的決定，畢竟「安全性」的問題好像還不止這個，這個真的是最重要的嗎？[Clickjacking](http://en.wikipedia.org/wiki/Clickjacking) 的問題呢？

**相關連結**

-   [swfupload - JavaScript & Flash Upload Library](http://code.google.com/p/swfupload/)
-   [Flash Player 10 Beta breaks file upload](http://wordpress.org/support/topic/177127)
-   Flash Player 10 FileReference Changes
-   Tough questions for Adobe
-   [FancyUpload for Flash 10](https://github.com/digitarald/digitarald-fancyupload)
-   Flash Player 10 upload and download requires user interaction

**將 Adobe Flash Player 10 降版到 Adobe Flash Player 9 的方法**

1.  先打開「控制台」中的「新增或移除程式」功能，並移除 Adobe Flash Player 10 ActiveX 軟體  
      
    
    ![image](https://stwillblogassets.blob.core.windows.net/files/images/external/stwillblogassets.blob.core.windows.net/73c64ff0855c694cf2a4-image_3.png)  
      
    
2.  之後到 [**這裡**](http://www.adobe.com/support/flashplayer/downloads.html#fp9) 下載舊版的 Flash Player 9 即可  
      
    請下載 [Download the Windows Flash Player 9 ActiveX control content debugger (for IE)](http://download.macromedia.com/pub/flashplayer/updaters/9/flashplayer_9_ax_debug.exe) 這項  
      
    
3.  安裝完成後就完成降版手續了。
