HTML使用input上傳檔案時,若想要限制檔案的類型時可以使用accept屬性。
指定副檔名
指定副檔名必須為csv
<input type="file" name="file" accept=".csv">
指定副檔名必須為pdf
<input type="file" name="file" accept=".pdf">
指定副檔名為一個以上時,可以使用逗號分開
<input type="file" name="file" accept=".csv,.pdf">
指定為某種type
圖片類型:
<input type="file" name="file" accept="image/*">
HTML類型:
<input type="file" name="file" accept="text/html">
影片類型:
<input type="file" name="file" accept="video/*">
音訊類型
<input type="file" name="file" accept="audio/*">
網站SEO優化沒有想像中複雜,只要能把握幾個重點,就能將網站排名提升囉!
對於 MySQL 資料庫資料操作的基本語法大全
Slow HTTP Denial of Service Attack 是以非常緩慢的速度進行http請求,霸佔伺服器服務,達到癱瘓伺服器的目的,解決方式即是設定 Timeout
大多數網站會員註冊都依賴Email作為主要驗證機制,當驗證Email寄給使用者後,卻又直接進入垃圾信箱,經常被抱怨收不到信!
reCAPTCHA是目前針對防範機器人最為有效的方式,廣泛使用在各政府機關、民間網站的網頁設計中,此篇文章教學申請取得金鑰步驟。