Posted by Gerry Vandermaesen on 04/25/06 10:20
In addition I'd advise you to be carefull performing operations on the
filesystem based on variables passed by the user.
Assuming userid contains the id of the authenticated user, better to
store it in a session (thus server side) on authentication.
Ehsan wrote:
> Hi,
>
> You will have to use mkdir() function to create a directory under
> uploads with the userid. After the if...condition in upload.php you can
> use the following code to create the directory:
>
> $uploadDirName = $_GET['userid'];
> $moveToDir_ = $moveToDir . "/". $uploadDirName;
> if (!is_dir($moveToDir))
> {
> mkdir($moveToDir, 0775);
> }
>
> $moveToDir = $moveToDir_;
>
> Hope this helps.
>
> Thanks and God Bless!!
>
> Ehsan
> http://ehsan.bdwebwork.com
[Back to original message]
|