franknu Posted October 20, 2006 Share Posted October 20, 2006 ok i want to upload a picture along some info. i have this code working before, but it seems that the picture was being saved in the database so i made some changes to save only the path in the databasenow it looks like it uploads the file but i cant find it anywhere. it is not in the database or folder can anyone pelease why it is doin that [code=php:0] <?php $uploaddir = realpath ("C://Program Files//EasyPHP1-8//home//townsfinder//"); $uploadfile = $uploaddir . basename($_FILES['Picture1']['name']);if(!empty($_FILES['Picture1'])) { var_dump($uploaddir); var_dump($_FILES['Picture1']['size']); var_dump($_FILES['Picture1']['error']); var_dump($_FILES['Picture1']['type']); var_dump($_FILES['Picture1']['name']); } if (move_uploaded_file($_FILES['Picture1']['tmp_name'], $uploaddir .$_FILES['Picture1']['name'])) { echo("File Uploaded"); } else { echo ("file no uploaded!"); print_r($_FILES); echo realpath('./'); } ?> [/code]this is my display: string(44) "C:\Program Files\EasyPHP1-8\home\townsfinder" int(19063) int(0) string(11) "image/pjpeg" string(8) "4c_1.jpg" File Uploaded Link to comment https://forums.phpfreaks.com/topic/24555-problem-uploading-a-picture/ Share on other sites More sharing options...
Psycho Posted October 20, 2006 Share Posted October 20, 2006 The $upload directory that is being returned does not have a backslash at the end. Perhaps the $uploadfile variable is not correct. Try displaying that on the page for debuggin purposes. Link to comment https://forums.phpfreaks.com/topic/24555-problem-uploading-a-picture/#findComment-111910 Share on other sites More sharing options...
franknu Posted October 20, 2006 Author Share Posted October 20, 2006 i did a echo on the directories and it it telling me that it is going there here is what is saying "C:\Program Files\EasyPHP1-8\home\townsfinder" int(19370) int(0) string(11) "image/pjpeg" string(22) "apple-bottom-jeans.jpg" File UploadedC:\Program Files\EasyPHP1-8\home\townsfinderC:\Program Files\EasyPHP1-8\home\townsfinderapple-bottom-jeans.jpg see it is telling it has been uploaded here:C:\Program Files\EasyPHP1-8\home\townsfinder Link to comment https://forums.phpfreaks.com/topic/24555-problem-uploading-a-picture/#findComment-111963 Share on other sites More sharing options...
franknu Posted October 20, 2006 Author Share Posted October 20, 2006 could be the space in C:\Program Files\ i tried renaming it but i couldnt it i change to another folder and it says bool(false) which is a good sign meaning this is bring in the picture and putting somewhere. Link to comment https://forums.phpfreaks.com/topic/24555-problem-uploading-a-picture/#findComment-111972 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.