Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1031701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T13:58:14+00:00 2026-05-16T13:58:14+00:00

My current directory structure is as follows: C:\xampp\htdocs\PHP_Upload_Image_MKDIR In other words, the following directories

  • 0

My current directory structure is as follows:

C:\xampp\htdocs\PHP_Upload_Image_MKDIR

In other words, the following directories do NOT exist at all.

C:\xampp\htdocs\PHP_Upload_Image_MKDIR\uploaded
C:\xampp\htdocs\PHP_Upload_Image_MKDIR\uploaded\s002

The problem is that when I run the following script, the function is_dir always return TRUE.

Based on the manual, https://www.php.net/manual/en/function.is-dir.php
is_dir: Returns TRUE if the filename exists and is a directory, FALSE otherwise.

Do I miss something here?

Thank you

$userID = 's002';
$uploadFolder = '/PHP_Upload_Image_MKDIR/uploaded/';
$userDir = $uploadFolder . $userID;
echo '<br/>$userDir: ' . $userDir . '<br/>';

if ( is_dir ($userDir))
{
  echo "dir exists"; // always hit here!!!
}
else 
{
  echo "dir doesn't exist";
}

mkdir($userDir, 0700);
C:\xampp\htdocs\PHP_Upload_Image_MKDIR>dir /ah
 Volume in drive C is System
 Volume Serial Number is 30B8-2BB2

 Directory of C:\xampp\htdocs\PHP_Upload_Image_MKDIR

File Not Found

C:\xampp\htdocs\PHP_Upload_Image_MKDIR>


//////////////////////////////////////////////////////////

Based on Artefacto’s comments:

Here is the output of C:\PHP_Upload_Image_MKDIR\uploaded\s005
 echo '<br/>' . realpath($userDir) . '<br/>';

Thank you for the solutions.

Best wishes

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T13:58:15+00:00Added an answer on May 16, 2026 at 1:58 pm

    Also, it seems as if the dir you are checking is PHP_Uploaded_Image_MKDIR/uploaded/s002, which is an absolute path starting from the root filesystem.

    Try prepending C:\xampp\htdocs\ to this and see if it works then. Also, check to see if the folder exists at the root of the volume.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I rename all hidden directories under the current directory in DOS? I've
I created a script that list the directories in the current directory <?php $dir
I have the following directory structure. root --src ---tests src contains the source &
I would like to see my current directory structure as a tree such that
Hello I just started working with CodeIgniter framework. My current directory structure is Demo(Project
I've got the following directory structure in tomcat 6: tomcat |-lib | |- logback-classic.jar
What is current directory of shell script? Is this current directory from which I
I want to create a file in the current directory (where the executable is
How to I extract a subdirectory in a tarball into the current directory? Example,
This is an example that searches PDF files in the current directory. import os,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.