Results 1 to 4 of 4

Thread: ftp_mkdir() error

  1. #1

    Thread Starter
    Addicted Member BIOSTALL's Avatar
    Join Date
    Apr 2005
    Location
    Northampton, UK
    Posts
    180

    ftp_mkdir() error

    Hey.. I'm tring to create a new folder. The folder name will be dependant upon the user enters. Say the user enters 'banana', I want to create a new folder with desination 'Photos/Live/banana'. But i'm getting this error:

    Warning: ftp_mkdir(): Photos/Live/banana: No such file or directory in /home/virtual/site13/fst/var/www/html/AddPhotos.php on line 88

    And this is the code i'm using:
    Code:
    $foldername = $_POST['userentry']; 
                            if (!ftp_mkdir($ftp_id, "Photos/Live/$foldername")) { 
                                echo "Cound not create new folder"; 
                                exit(); 
                            }
    Anyone please tell me how i may resolve this issue please??

    Many thanks, BIOSTALL

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: ftp_mkdir() error

    The error is saying that the directory "Photos/Live/" does not exist. You need to make sure the parent directory exists.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    Addicted Member BIOSTALL's Avatar
    Join Date
    Apr 2005
    Location
    Northampton, UK
    Posts
    180

    Re: ftp_mkdir() error

    Quote Originally Posted by visualAd
    The error is saying that the directory "Photos/Live/" does not exist. You need to make sure the parent directory exists.
    It does exist... i made it myself and i can view it via my FTP software.

  4. #4
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: ftp_mkdir() error

    I notice you are using a relative path, is that correct. You may to to chdir or use the absolute path i.e: "Photos/Live/"
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width