在php框架CI2以上版本做php框架上傳文件時(shí),出現(xiàn)了You did not select a fileto upload,這樣的上傳錯(cuò)誤提示,單在實(shí)際上傳中已經(jīng)選擇了文件。
解決方法。
1.首先確定自己的form提交 有enctype="multipart/form-data"配置
2.提交的file表單name比如為upfilename,那么你在controllers中獲取的時(shí)候也要用該名稱$this->upload->do_upload("upfilename")
這兩個(gè)保持一致。
這樣就不會(huì)出現(xiàn)You did not select a file to upload找不到上傳文件的情況了。
當(dāng)上傳中文名稱文件的時(shí)候出現(xiàn)
A problem was encountered while attempting to move the uploaded file tothe final destination.
這個(gè)錯(cuò)誤提示,原因就中文名稱,將中文更改為其他字母數(shù)字等即可。
更多信息請(qǐng)查看IT技術(shù)專欄