# 上傳檔案 表單傳檔案 :::success 目標:將檔案上傳至public資料夾 ::: :::danger 避免: - 檔名重複,造成檔案覆蓋 :point_right: 日期+亂數取新檔名 ::: form寫法: `<form action="/news/store" method="POST" class="mx-auto" enctype="multipart/form-data">` input寫法: `<input type="file" accept="image/*" id="img" name="img">` // accept 指定可上傳格式 參考 :point_right: https://blog.gtwang.org/web-development/html-input-accept-attribute-tutorial/ 補血包: :arrow_down: https://hackmd.io/o_O0BuOcR_-rxbcjQIqOHA?view#%E6%AA%94%E6%A1%88%E4%B8%8A%E5%82%B3
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up