Server upload file error - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Server upload file error (/showthread.php?tid=79272) |
Server upload file error - pippuccio76 - 05-20-2021 HI sorry for english in one project i use dropzone to send image or pdf to server with ajax , this is my function : PHP Code: public function dropzone_estratti_conto() The name are stored in db but the file there'arent , how is it possible ?i have more than 1000 record and only this time i have this problem.... Can i add more control to increase security ? RE: Server upload file error - includebeer - 05-20-2021 Sometime it work and sometime it doesn't? Are sure the filename is a valid filename for your filesystem and the target directory is writable? RE: Server upload file error - pippuccio76 - 05-20-2021 (05-20-2021, 02:11 PM)includebeer Wrote: Sometime it work and sometime it doesn't? Are sure the filename is a valid filename for your filesystem and the target directory is writable? I found the file out of folder as $this->session->get('user_id') is empty , how can i prevent it ? RE: Server upload file error - InsiteFX - 05-21-2021 That tells me that you have an error in your code someplace that is over writing or not saving the users id. I would backtrace an check my session code. RE: Server upload file error - pippuccio76 - 05-21-2021 (05-21-2021, 02:51 AM)InsiteFX Wrote: That tells me that you have an error in your code someplace that is over writing or not saving the users id. This is the path where i save file : $targetDir = FCPATH . '/xyz_xrh/documenti_personali/'.$this->session->get('user_id'); Because the file are uploaded by ajax , to solve the problem i must refresh my project to control if session are set . Is There a way to do this for all page ? RE: Server upload file error - InsiteFX - 05-21-2021 Change your code to this and see if you get the same results. PHP Code: $targetDir = FCPATH . '/xyz_xrh/documenti_personali/'.session('user_id'); Also what type of sessions are you running file, database etc; RE: Server upload file error - pippuccio76 - 05-21-2021 (05-21-2021, 04:23 AM)InsiteFX Wrote: Change your code to this and see if you get the same results. i use file , can i set : Code: $sessionExpiration = 0; to prevent ?in this way if browser is open $this->session->get('user_id') is set until the user close browser RE: Server upload file error - InsiteFX - 05-21-2021 Yes you can the way I showed you is using the session helper. |