Unable to create folder

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • deepaks85
    New Member
    • Aug 2006
    • 114

    #1

    Unable to create folder

    Dear Sir,

    I have written a php script to create folder :

    <?php
    $targetpath = $_SERVER['DOCUMENT_ROOT'] . "/reports/";
    $target = $targetpath . basename( $_FILES['uploadedfile']['name']);

    mkdir($targetpa th.$vName,0700) ;
    ?>

    when I run this script I get this error :
    Warning: mkdir(/home/content/O/n/l/Onlin7r7sbiz/html/reports/): File exists in /home/content/O/n/l/Onlin7r7sbiz/html/save.php on line 65

    Please tell me the reason.

    Thanks
    Deepak
  • raji20
    New Member
    • Aug 2006
    • 28

    #2
    Originally posted by deepaks85
    Dear Sir,

    I have written a php script to create folder :

    <?php
    $targetpath = $_SERVER['DOCUMENT_ROOT'] . "/reports/";
    $target = $targetpath . basename( $_FILES['uploadedfile']['name']);

    mkdir($targetpa th.$vName,0700) ;
    ?>

    when I run this script I get this error :
    Warning: mkdir(/home/content/O/n/l/Onlin7r7sbiz/html/reports/): File exists in /home/content/O/n/l/Onlin7r7sbiz/html/save.php on line 65

    Please tell me the reason.

    Thanks
    Deepak
    the name of file/folder which you are trying to create already exists

    This is the code which i have used to create a dir, it works for me

    $targetpath = "/www/htdocs/phpdocs/Practice/";
    $target = $targetpath . "dirToBeCreated ";
    mkdir($target,0 777);

    Comment

    Working...