Welcome Guest, Not a member yet? Register   Sign In
Server upload file error
#1

(This post was last modified: 05-20-2021, 10:57 AM by pippuccio76.)

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()
    {
        

        
//recupero le informazioni del file
        $img $this->request->getFile('userfile');

        $targetDir FCPATH '/xyz_xrh/documenti_personali/'.$this->session->get('user_id');


        //recupero tutti i valori via post
        $post $this->request->getPost();

        $post['nome_file_originale'] = $img->getName();
 


        //creo un nome casuale
        $newName =$post['id_isee'].'*estratti_conto*'.time().'*'.$img->getName();
        
        
//lo rinomino
        if($img->move($targetDir$newName)){

            //istanzio il model 
            $isee_documenti_estratto_conto_model = new Isee_documenti_estratto_contoModel();

            $post['nome_file'] =$newName ;

            //inserisco i valori nel db 
            $res=$isee_documenti_estratto_conto_model->save($post);

            $id_tabella $isee_documenti_estratto_conto_model->getInsertID();
         }


            echo "{}";


        
    


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 ?
Reply


Messages In This Thread
Server upload file error - by pippuccio76 - 05-20-2021, 10:55 AM
RE: Server upload file error - by includebeer - 05-20-2021, 02:11 PM
RE: Server upload file error - by pippuccio76 - 05-20-2021, 03:59 PM
RE: Server upload file error - by InsiteFX - 05-21-2021, 02:51 AM
RE: Server upload file error - by pippuccio76 - 05-21-2021, 04:01 AM
RE: Server upload file error - by InsiteFX - 05-21-2021, 04:23 AM
RE: Server upload file error - by pippuccio76 - 05-21-2021, 07:38 AM
RE: Server upload file error - by InsiteFX - 05-21-2021, 11:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB