SitePoint Sponsor

User Tag List

Results 1 to 1 of 1
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    Montgomery, TX
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ftp_delete problem

    I let users upload photos to my site. I am now trying to let them delete the photos that they uploaded. Below, you'll see where $delete_result calls function ftpDeleteFile. The return result is false, but the file does get deleted. Can anyone explain why this might be?

    PHP Code:
        $delete_result ftpDeleteFile($ftp_path$file);

        if (
    $delete_result == "false")
          {
          echo 
    "delete from server failed";
          }

    function 
    ftpDeleteFile($dir$file)
      {
      
    $delfile $dir $file';
      
      ftpChmodDir($dir, '
    0777'); //function to chmod a directory by ftp

      $ftpconn = ftpConnect(); //returns an ftp connection
      $result = ftp_delete($ftpconn, $delfile);

      ftpChmodDir($dir, '
    0755');

      return $result;

      } 
    Thanks,

    David
    Last edited by dkroll; Jun 5, 2003 at 13:38. Reason: bump


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
  •