php - Image cannot be display after uploading -
previously, when tried uploading image database, image won't display. when check path in db , in folder, correct.
correct path in db , folder.
and when tried view image has been uploaded says don't have permission view it.
i have tried uploaded different photo extension , different photo viewer application , still cannot view image. apart that, have tried w3school php5 file upload. again same thing happen, cannot view image.
this code :
if (!isset($_files['image']['tmp_name'])) { echo ""; } else { $file=$_files['image']['tmp_name']; $location= $_server['document_root'] . '/ehars/photo/' . $_files["image"]["name"]; move_uploaded_file($_files["image"]["tmp_name"], $_server['document_root'] . '/ehars/photo/' . $_files["image"]["name"]); mysql_query("insert photo (location,emp_id) values ('$location','$emp_id')"); }
why can't view image? because of document root? or else? please me thank you.
updated :
based on image below, code (as shown above) inside admin folder. reason why save images in /ehars/photos that, every level of user, admin admin2 , user can view same photo has been uploaded. if advice me best way in order achieve objective above. again!
if url scheme not "file://", should authorized browser. remember can't link css , image local machine due security reasons.
Comments
Post a Comment