今天給網站后臺增加一個上傳文件的功能,結果出現BUG,提示未選擇上傳文件。
以下是代碼部分。
1
2
3
4
5
6
7
8
9
10
|
< form method = "post" action = "attached.php?action=upload_post" enctype = "multipart/form-data" > < table width = "100%" cellspacing = "0" cellpadding = "0" border = "0" > < tr > < td >< input type = "file" name = "attaFile" id = "attaFile" /> </ tr > < tr > < td valign = "bottom" height = "50" >< button type = "submit" id = "attaBtn" >確定</ button ></ td > </ tr > </ table > </ form > |
檢查半天感覺代碼也沒有問題啊,懷著試試看態度把 name="attaFile" 改成 name="attafile" 就是大寫F改成小寫,結果上傳成功了。
就這個問題浪費了半天時間,我也是醉了,不知道是SAE的問題,還是所有服務器都這樣。
以上所述就是本文的全部內容了,希望大家能夠喜歡。