Codeigniters do_upload() function is not working

前端 未结 2 503
醉酒成梦
醉酒成梦 2020-12-12 05:43

If I remove the part $this->upload->do_upload(\'filefoto\') my data is saved into the database, but the image file is not saved to the folder path.

相关标签:
2条回答
  • 2020-12-12 06:04

    you missed this

    $this->upload->upload_path.'/'.$this->upload->file_name;
    
    0 讨论(0)
  • 2020-12-12 06:14

    on a shared server hosting you may need to provide the complete relative path to your upload folder. Also make sure you have all permissions to write a file to that directory!

    you can use on a localhost environment

    $config['upload_path']   = './assets/upload'; 
    

    but on a shared hosting, you'll need to get more specific, normally something like

    $config['upload_path']   = '/home/yourserver/public_html/assets/upload'; 
    

    You can find this upload_path, e.g. in your accounts cPanel main page on the left column or might want to call your provider's helpdesk for more info on the correct path.

    0 讨论(0)
提交回复
热议问题