Server upload file error |
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 ?
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?
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
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. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(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 ?
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; What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(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
Yes you can the way I showed you is using the session helper.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |