這裡是 PHP 5.2.0 的 Release Announcement。
之前在研究 AJAX 的時候,就一直覺得 JavaScript 應該是沒有辦法處理 <input type=”file” …> 的資料(不可能讓 js 直接讀檔吧!),結果在 PHP 5.2.0 的 key feature 裡就讓我發現了這個:
Hooks for tracking file upload progress were introduced.
這篇文章也介紹了用 PHP 5.2 加上 Yahoo! UI Library 來作一個 AJAX 的 upload progress bar。
剛好放假回來,又看到 PHP 的公告中有一句:
All users of PHP, especially those using earlier PHP 5 releases are advised to upgrade to this release as soon as possible. This release also obsoletes the 5.1 branch of PHP.
所以就趁這個時間更新了一下囉!
js 讀檔? 我猜可以自己做出來…
user 選完檔案時 (e.g.onchange),把檔送上 server,然後再透過 ajax 抓回來 :p
送上 server 時不就用了一次 POST?