Jump to content

problem uploading a picture


franknu

Recommended Posts

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 database

now 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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.