JavedBaloch's avatar

Images are being storing as .tmp ?

Hello,

I want to upload multiple images but the problem is its being stroing as .tmp file.

here is my code.

 if($files=$request->file('cheque_image')){
            foreach($files as $file){
                $name=time().'_'.$file->getClientOriginalName();
                $file->move(public_path('assets/images/cheques/',$name));
           }
}
0 likes
4 replies
siangboon's avatar
Level 54
if($files=$request->file('cheque_image')){
            foreach($files as $file){
                $name=time().'_'.$file->getClientOriginalName();
                $file->move(public_path() . 'assets/images/cheques/', $name);
           }
}
1 like
sevenTopo's avatar

you can do that:

 
foreach ($request->file('cheque_image') as  $key=> $file) {
              $image->move(public_path('img/uploads/'), $image->getClientOriginalName());
              $content["name"][]=$image->getClientOriginalName();
            } //if you are trying to store the data in DB i suggest to use json_encode 
 $content["name"] = json_encode($content["source"]);

Please or to participate in this conversation.