0

Hi ,
I am design our website , and my requirement is to upload image.
I want to upload image seperate for every user... when user register in my website a dynamic folder is created through his userid ..and photo is store in his directory.it is for every user seperetally..
plz give me idea or code
i am thankful to u
narendra

2
Contributors
1
Reply
3
Views
6 Years
Discussion Span
Last Post by Shanti C
0

use mkdir to make a directory.
Give user login name for this directory.
and you can store all uploaded images by this user in this directory by giving this directory path like:
assume login name is stored in session
$dirname=$_SESSION;
after creating directory..
save the uploaded images in this folder..

$dirname=$_SESSION['login_name'];
 if (file_exists("upload/" . $_FILES["file"]["name"]))
      {
      echo $_FILES["file"]["name"] . " already exists. ";
      }
    else
      {
      move_uploaded_file($_FILES["file"]["tmp_name"],
      "$dirname/" . $_FILES["file"]["name"]);
      echo "Stored in: " . "$dirname/" . $_FILES["file"]["name"];
      }
    }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.