[教學] 好用的上傳 pear 模組 HTTP_Upload

看板PHP作者 (小惡魔)時間17年前 (2008/10/24 17:15), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
http://pear.php.net/package/HTTP_Upload 我忘記看到哪一篇的推文,所以就去用了一下,發現很好用唷 * Can handle from one file to multiple files. * Safe file copying from tmp dir. * Easy detecting mechanism of valid upload, missing upload or error. * Gives extensive information about the uploaded file. * Rename uploaded files in different ways: as it is, safe or unique * Validate allowed file extensions * Multiple languages error messages support (es, en, de, fr, it, nl, pt_BR) 其實作法還蠻容易的,提供很多 file 的參數使用 /* 印出所有檔案資訊 */ # $file->getProp("size") 檔案大小 # $file->getProp("name") 亂數取檔名 # $file->getProp("real") 上傳的真正檔名 # $file->getProp("ext") 上傳的副檔名 /* 檔案資訊 */ echo "<pre>"; print_r($file->getProp()); echo "</pre>"; 教學網址:http://blog.wu-boy.com/2008/10/24/563/ 這是上傳部份,下載部份可以利用這個網頁: http://blog.wu-boy.com/2007/05/25/106/ -- Appleboy Blog: http://blog.Wu-Boy.com Appleboy Life: http://life.wu-boy.com 迷你寫真部落格:http://mini101.twgg.org -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.123.107.42
文章代碼(AID): #190P9EuP (PHP)
文章代碼(AID): #190P9EuP (PHP)