skip to Main Content

i need file upload function. but when i run this code then show this type error – PHP

<?php $target_dir = "uploads/"; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $uploadOk = 1; $imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION)); // Check if image file is a actual image or fake image if(isset($_POST["submit"])) { $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]); if($check !== false) { echo "File is an…

VIEW QUESTION

Laravel: Uploaded image not showing

i keep getting 404 image not found when viewing the uploaded image on my project but the image is there. im using laravel's asset() helper to retrieve the image. the url in chrome shows http://127.0.0.1:8000/images/dU8oaVTAwQyTor86jvDtdGKvE7H3MYkHZuUG60gH.png and ive already done php…

VIEW QUESTION

Undefined variable: image while update in laravel

public function update_room_detail(Request $request) { $request->validate([ 'room_type' => 'required', ]); if($images = $request->file('room_image')) { foreach($images as $item): $var = date_create(); $time = date_format($var, 'YmdHis'); $imageName = $time.'-'.$item->getClientOriginalName(); $item->move(public_path().'/assets/images/room', $imageName); $arr[] = $imageName; endforeach; $image = implode("|", $arr); } else {…

VIEW QUESTION

Codeigniter 4 Multiple Image Upload Issue – PHP

When I update the database, it uploads a single image. How do I upload multiple? $id = $this->request->getPost('id'); $model = new UrunModel(); $file = $this->request->getFile('resim'); $resim_eski = $model->find($id); if($file->isValid() && !$file->hasMoved()){ $eski_resim = $resim_eski['resim']; if(file_exists("dosyalar/uploads".$eski_resim)){ unlink("dosyalar/uploads".$eski_resim); } $imagename = $file->getRandomName();…

VIEW QUESTION
Back To Top
Search