php - Difficulties retrieving image file with file_get_content -
i'm trying fetch image path , fopen corresponding image in tmp directory, page displays empty img placeholder pic. in advance
public function getimage($path) { if($result = $this->db->prepare("select filename trips filename=?")) { $result->bind_param('s', $path); $result->execute(); $result->bind_result($filename); if($result->fetch()) { header("content-type: image/jpeg"); if(!file_exists("c:/xampp/htdocs/webshop/public/img/content/" . $filename)) { imagefilter($image, img_filter_grayscale); imagejpeg($image, "c:/xampp/htdocs/webshop/public/img/content/" . $filename); } else { $image = imagecreatefromjpeg("c:/xampp/htdocs/webshop/public/img/content/" . $filename); } imagejpeg($image); } else { echo "error"; } } else { echo "table retrieve failed: (" . $this->db->error . ") " .$this->db->error; } var_dump($img); homecoming $image; }
php string file-get-contents image-uploading
No comments:
Post a Comment