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