Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: FTP file creation

  1. #11
    Join Date
    Nov 2008
    Posts
    8
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Smile

    I've figured it out, and it's working now!

    I used a completely different code:

    PHP Code:
        $ftp_server $ftpserver;
        
    $ftp_user $ftpuser;
        
    $ftp_password $ftppass;

        
    $conn_id ftp_connect($ftp_server);
        
    $login_result ftp_login($conn_id$ftp_user$ftp_password);

        if((!
    $conn_id) || (!$login_result))
        {
                echo 
    "FTP connection has failed!";
                echo 
    "Attempted to connect to $ftp_server for user $ftp_user";
           }

        @
    ftp_mkdir($conn_id'/public_html/profiles/" . $userUsername . "');

        
    $temp tmpfile();
        
    //Upload the temporary file to server
        
    @ftp_fput($conn_id'/public_html/profiles/" . $userUsername/$userUsername . ".html'$tempFTP_BINARY);

        
    ftp_close($conn_id); 
    This all works fine now and the files and directories are created on submit.

    Thanks very much for all of your help John.

  2. #12
    Join Date
    Oct 2008
    Posts
    42
    Thanks
    0
    Thanked 9 Times in 9 Posts

    Default

    you're welcome. glad you got it working

Bookmarks

Posting Permissions

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