move_uploaded_file說明bool move_uploaded_file ( string filename, string destination )本函數檢查並確保由 filename 特殊的檔案是合法的上傳檔案(即通過 PHP 的 HTTP POST 上傳機制所上傳的)。若果檔案合法,則將其搬移為由 destination 特殊的檔案。 若果 filename 不是合法的上傳檔案,不會出現任何動作,move_uploaded_file() 將返回 FALSE。 若果 filename 是合法的上傳檔案,但出於某些原因無法搬移,不會出現任何動作,move_uploaded_file() 將返回 FALSE。此外還會發出一條警示。 這種檢查顯得格外重要,若果上傳的檔案有可能會造成對會員或本系統的其他會員顯示其內容的話。
參見 is_uploaded_file(),以及檔案上傳處理一章中的簡單使用例子。 | ||||