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/*">
Laravel 部署時發生Error
當我們使用SSH連線時,該如何限制IP,設定允許連線的IP白名單呢,以Centos7為例。
因為不是每天都在建置新專案,也不是每天都有網站上線,即使是遇到過無數次的問題,依然會在很久之後再次卡關,因此我把某些容易忽略的小細節記錄下來
更新 composer 依然無法解決 No such file or directory 問題嗎?深入問題解決。
Laravel beginTransaction 使用$connection指定連線資料庫時若單純rollback會發生失敗的情況