grahamgr3 Posted February 27, 2014 Share Posted February 27, 2014 For some reason the images I am uploading to my uploads folder are just showing as blank, the files are there but it is not showing them as images. It is written that the type of file it is is just File. and it shows the path to the image D:\xampp\htdocs\uploads. My add_print.php is just fine as far as I can tell. I tested it with the script written by Larry in the working files for this book, it doesn't work either. I checked my permissions for my uploads folder and they look fine too. I am thinking the problem is maybe because no Mime type is specified for the images being uploaded. If that isn't where the error is, it is maybe in the code below, where my uploads folder is. it is specified as ../../../uploads. any help would be appreciated. if (is_uploaded_file($_FILES['image']['tmp_name'])){ $temp = '../../../uploads/' . md5($_FILES['image']['name']); if (move_uploaded_file($_FILES['image']['tmp_name'], $temp)){ echo '<p>The file has been uploaded!</p>'; $i = $_FILES['image']['name']; or could the problem be below:? if (mysqli_stmt_affected_rows($stmt) == 1){ echo '<p>The print has been added.</p>'; $id = mysqli_stmt_insert_id($stmt); rename ($temp, "../../../uploads/$id"); $_POST = array(); Link to comment Share on other sites More sharing options...
Larry Posted February 28, 2014 Share Posted February 28, 2014 That's all fine, because the images won't be accessed through the file system, but rather through a proxy script that will also provided the MIME type to the browser. Link to comment Share on other sites More sharing options...
Lynn Posted April 4, 2019 Share Posted April 4, 2019 I noticed the same thing and my image would not display on the view_print page. is there a reason why? Link to comment Share on other sites More sharing options...
Larry Posted April 4, 2019 Share Posted April 4, 2019 There could be several reasons why. To debug it, you'll want to take the src value for the img (from the browser HTML source) and run that directly in a browser to see what, if any, PHP error is reported. Link to comment Share on other sites More sharing options...
Recommended Posts