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/*">
Slow HTTP Denial of Service Attack 是以非常緩慢的速度進行http請求,霸佔伺服器服務,達到癱瘓伺服器的目的,解決方式即是設定 Timeout
當我們使用 migrate 出現以下訊息:Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
以PHP實作Google reCAPTCHA驗證
遇到 ChatGPT 無法回應、連不上或出現錯誤訊息嗎?別急著以為是你電腦壞掉,其實可能是 OpenAI 的服務正在維護或異常。本文教你如何查詢 ChatGPT 是否出現問題,快速判斷是否為全部用戶的狀況!
PHP Laravel 取得客戶端IP的方式介紹