• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP ftp_delete函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ftp_delete函数的典型用法代码示例。如果您正苦于以下问题:PHP ftp_delete函数的具体用法?PHP ftp_delete怎么用?PHP ftp_delete使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ftp_delete函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: clean

 /**
  * @param string $file
  */
 private function clean($file)
 {
     if (ftp_size($this->connection, $file) == -1) {
         $result = ftp_nlist($this->connection, $file);
         foreach ($result as $childFile) {
             $this->clean($childFile);
         }
         ftp_rmdir($this->connection, $file);
     } else {
         ftp_delete($this->connection, $file);
     }
 }
开发者ID:LibraryOfLawrence,项目名称:pagekit,代码行数:15,代码来源:FtpTestCase.php


示例2: DeleteFile

function DeleteFile($fichierAsupprimer)
{
    global $ftp;
    // Tente d'effacer le fichier $file
    if (ftp_delete($ftp, $fichierAsupprimer)) {
        echo "{$fichierAsupprimer} effacé avec succès\n";
    } else {
        echo "Impossible d'effacer le fichier {$fichierAsupprimer}\n";
    }
    return 1;
}
开发者ID:R3D2,项目名称:CFPTEI_ServerRoom,代码行数:11,代码来源:index.php


示例3: DeleteUpfile

function DeleteUpfile($R, $d)
{
    global $g, $table;
    $UPFILES = getArrayString($R['upload']);
    foreach ($UPFILES['data'] as $_val) {
        $U = getUidData($table['s_upload'], $_val);
        if ($U['uid']) {
            if ($U['url'] == $d['comment']['ftp_urlpath']) {
                $FTP_CONNECT = ftp_connect($d['comment']['ftp_host'], $d['comment']['ftp_port']);
                $FTP_CRESULT = ftp_login($FTP_CONNECT, $d['comment']['ftp_user'], $d['comment']['ftp_pass']);
                if ($d['comment']['ftp_pasv']) {
                    ftp_pasv($FTP_CONNECT, true);
                }
                if (!$FTP_CONNECT) {
                    getLink('', '', 'FTP서버 연결에 문제가 발생했습니다.', '');
                }
                if (!$FTP_CRESULT) {
                    getLink('', '', 'FTP서버 아이디나 패스워드가 일치하지 않습니다.', '');
                }
                ftp_delete($FTP_CONNECT, $d['comment']['ftp_folder'] . $U['folder'] . '/' . $U['tmpname']);
                if ($U['type'] == 2) {
                    ftp_delete($FTP_CONNECT, $d['comment']['ftp_folder'] . $U['folder'] . '/' . $U['thumbname']);
                }
                ftp_close($FTP_CONNECT);
            } else {
                unlink($U['url'] . $U['folder'] . '/' . $U['tmpname']);
                if ($U['type'] == 2) {
                    unlink($U['url'] . $U['folder'] . '/' . $U['thumbname']);
                }
            }
            getDbDelete($table['s_upload'], 'uid=' . $U['uid']);
        }
    }
}
开发者ID:kieregh,项目名称:test_comment,代码行数:34,代码来源:action.func.php


示例4: del

 public function del($file)
 {
     if (!$this->connect_id) {
         return false;
     }
     return ftp_delete($this->connect_id, $file);
 }
开发者ID:cbsistem,项目名称:nexos,代码行数:7,代码来源:cpg_ftp.php


示例5: unlink_attach

/**
* Deletes an Attachment
*/
function unlink_attach($filename, $mode = false)
{
    global $upload_dir, $config, $lang;
    $filename = basename($filename);
    if (!intval($config['allow_ftp_upload'])) {
        if ($mode == MODE_THUMBNAIL) {
            $filename = $upload_dir . '/' . THUMB_DIR . '/t_' . $filename;
        } else {
            $filename = $upload_dir . '/' . $filename;
        }
        $deleted = @unlink($filename);
    } else {
        $conn_id = attach_init_ftp($mode);
        if ($mode == MODE_THUMBNAIL) {
            $filename = 't_' . $filename;
        }
        $res = @ftp_delete($conn_id, $filename);
        if (!$res) {
            if (ATTACH_DEBUG) {
                $add = $mode == MODE_THUMBNAIL ? '/' . THUMB_DIR : '';
                message_die(GENERAL_ERROR, sprintf($lang['Ftp_error_delete'], $config['ftp_path'] . $add));
            }
            return $deleted;
        }
        @ftp_quit($conn_id);
        $deleted = true;
    }
    return $deleted;
}
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:32,代码来源:functions_delete.php


示例6: save

 /**
  * Salva o conteúdo do arquivo no servidor Oracle
  * Caso seja possível salvar o arquivo, será retornado
  * o filename completo de onde o arquivo será armazenado
  * 
  * @param Zend_Db $db
  * @return string
  */
 public function save($db = null)
 {
     if ($db == null) {
         $db = Zend_Registry::get('db.projta');
     }
     if ($this->_content instanceof ZendT_Type_Blob) {
         $sql = "\n                    declare\n                      v_blob BLOB;\n                    begin\n                       insert into tmp_blob(content) values (:content);\n                       select content into v_blob FROM tmp_blob;\n                       arquivo_pkg.write_to_disk(p_data => v_blob,\n                                                 p_file_name => :name,\n                                                 p_path_name => :path);\n                    end;                \n                ";
         @($conn = ftp_connect('192.168.1.251'));
         if (!$conn) {
             throw new ZendT_Exception(error_get_last());
         }
         @($result = ftp_login($conn, 'anonymous', 'anonymous'));
         if (!$result) {
             throw new ZendT_Exception(error_get_last());
         }
         $fileNameServer = 'pub/temp/' . $this->_name;
         @ftp_delete($conn, $fileNameServer);
         @($result = ftp_put($conn, $fileNameServer, $this->_fileName, FTP_BINARY));
         if (!$result) {
             throw new ZendT_Exception(error_get_last() . ". Name Server: {$fileNameServer} || Name Local: {$this->_fileName}");
         }
         @($result = ftp_close($conn));
     } else {
         $sql = "\n                    begin\n                    arquivo_pkg.write_to_disk(p_data => :content,\n                                              p_file_name => :name,\n                                              p_path_name => :path);\n                    end;                \n                ";
         $stmt = $db->prepare($sql);
         $stmt->bindValue(':content', $this->_content);
         $stmt->bindValue(':name', $this->_name);
         $stmt->bindValue(':path', $this->_path);
         $stmt->execute();
     }
     $filename = $this->_path . '/' . $this->_name;
     return $filename;
 }
开发者ID:rtsantos,项目名称:mais,代码行数:41,代码来源:Attachment.php


示例7: FTPDelete

 public function FTPDelete($file)
 {
     if (!@ftp_delete($this->connection, $file)) {
         require_once 'Newstool/FTP/Exception.php';
         throw new Newstool_FTP_Exception('Could not delete the file');
     }
 }
开发者ID:TheDragon,项目名称:work_code_samples,代码行数:7,代码来源:FTP.php


示例8: del_file

 function del_file($path)
 {
     $this->off = @ftp_delete($this->conn_id, $path);
     if (!$this->off) {
         echo "文件删除失败,请检查权限及路径是否正确!";
     }
 }
开发者ID:nick198205,项目名称:yiqixiu,代码行数:7,代码来源:Ftp.class.php


示例9: delete

 public function delete($strPath)
 {
     if (stristr($strPath, "*") === false) {
         //*** Regular FTP delete.
         try {
             @ftp_delete($this->objFTP, $strPath);
         } catch (Exception $e) {
             echo $e->getMessage();
         }
     } else {
         //*** Wildcard delete.
         $strBasePath = dirname($strPath);
         $strFileName = basename($strPath);
         //*** Get files in remote folder.
         $arrFiles = $this->nlist($strBasePath);
         if ($arrFiles !== false) {
             foreach ($arrFiles as $strFile) {
                 $strBaseFile = basename($strFile);
                 if (!$this->is_dir($strFile) && $this->hasWildcard($strFileName, $strBaseFile)) {
                     @ftp_delete($this->objFTP, $strBasePath . "/" . $strBaseFile);
                 }
             }
         }
     }
 }
开发者ID:laiello,项目名称:punchcms,代码行数:25,代码来源:class.ftp.php


示例10: mdelete

 function mdelete($path)
 {
     if (!$this->conn_id) {
         return false;
     }
     return @ftp_delete($this->conn_id, $path);
 }
开发者ID:polarlight1989,项目名称:08cms,代码行数:7,代码来源:ftp.fun.php


示例11: delete

 function delete($filename)
 {
     if (!@ftp_delete($this->ftp_conn, $filename)) {
         $this->error[] = "Could not delete {$filename}";
         return false;
     }
     return true;
 }
开发者ID:Hezkibel,项目名称:soft,代码行数:8,代码来源:_ftps.php


示例12: remove

 function remove($ident)
 {
     $conn_id = ftp_connect(__FTP_SERVER__);
     $login_result = ftp_login($conn_id, __FTP_UNAME__, __FTP_PASSWD__);
     $ret = ftp_delete($conn_id, __FTP_DIR__ . "/" . $ident);
     ftp_close($conn_id);
     return $ret;
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:8,代码来源:ftp_storage.php


示例13: ftpDelete

 protected function ftpDelete($path)
 {
     $result;
     $conn_id = ftp_connect(FTP_SERVER);
     $login_result = ftp_login($conn_id, FTP_USER_NAME, FTP_USER_PASS);
     $result = ftp_delete($conn_id, $path);
     ftp_close($conn_id);
     return $result;
 }
开发者ID:TaikiFnit,项目名称:CMS-on-PHP-v2,代码行数:9,代码来源:appModel.php


示例14: deleteFiles

 protected function deleteFiles($files)
 {
     foreach ($files as $file) {
         $success = ftp_delete($this->connection, $file);
         if (!$success) {
             throw new \Exception('Could not delete file from ftp: ' . $file);
         }
     }
 }
开发者ID:henrytrager,项目名称:BackupTask,代码行数:9,代码来源:FtpUpload.php


示例15: deleteimg

function deleteimg($img)
{
    $imgd = $img;
    $conn = ftp_connect("localhost");
    ftp_login($conn, "root", "sandy");
    ftp_chdir($conn, "dj/images");
    echo ftp_delete($conn, "{$imgd}.jpg");
    ftp_close($conn);
}
开发者ID:samvrit,项目名称:Projects,代码行数:9,代码来源:functions.php


示例16: ftp_image_delete_file

 static function ftp_image_delete_file($sourceFileName)
 {
     if (self::ftp_image_connect()) {
         if (@ftp_delete(ImageLib::$ftp_image_connect_id, $sourceFileName)) {
             return true;
         }
     }
     return false;
 }
开发者ID:duynhan07,项目名称:elink,代码行数:9,代码来源:ImageLib.php


示例17: limitbackup

 public function limitbackup()
 {
     $fileList = $this->getBackupTimeList();
     $connection = $this->getConnection();
     for ($index = 0; count($fileList) > $this->limit - 1; ++$index) {
         $fileName = Vtiger_BackupZip::getDefaultFileName($fileList[$index]);
         @ftp_delete($connection, $fileName);
         unset($fileList[$index]);
     }
 }
开发者ID:kduqi,项目名称:corebos,代码行数:10,代码来源:FTPBackup.php


示例18: delete

 public function delete($file)
 {
     if (ftp_size($this->connection, $file) != -1) {
         $delete = ftp_delete($this->connection, $file);
         if ($delete) {
         } else {
         }
     }
     return $this;
 }
开发者ID:natgeo,项目名称:kids-myshot,代码行数:10,代码来源:ftp.php


示例19: ftp_rmdirr

/**
 * Recursively delete the files in a directory via FTP.
 *
 * @author      Aidan Lister <[email protected]>
 * @version     1.0.0
 * @link        http://aidanlister.com/2004/04/recursively-deleting-directories-via-ftp/ 
 * @param       resource $ftp_stream   The link identifier of the FTP connection
 * @param       string   $directory    The directory to delete
 */
function ftp_rmdirr($ftp_stream, $directory)
{
    // Sanity check
    if (!is_resource($ftp_stream) || get_resource_type($ftp_stream) !== 'FTP Buffer') {
        return false;
    }
    // Init
    $i = 0;
    $files = array();
    $folders = array();
    $statusnext = false;
    $currentfolder = $directory;
    // Get raw file listing
    $list = ftp_rawlist($ftp_stream, $directory, true);
    // Iterate listing
    foreach ($list as $current) {
        // An empty element means the next element will be the new folder
        if (empty($current)) {
            $statusnext = true;
            continue;
        }
        // Save the current folder
        if ($statusnext === true) {
            $currentfolder = substr($current, 0, -1);
            $statusnext = false;
            continue;
        }
        // Split the data into chunks
        $split = preg_split('[ ]', $current, 9, PREG_SPLIT_NO_EMPTY);
        $entry = $split[8];
        $isdir = $split[0][0] === 'd' ? true : false;
        // Skip pointers
        if ($entry === '.' || $entry === '..') {
            continue;
        }
        // Build the file and folder list
        if ($isdir === true) {
            $folders[] = $currentfolder . '/' . $entry;
        } else {
            $files[] = $currentfolder . '/' . $entry;
        }
    }
    // Delete all the files
    foreach ($files as $file) {
        ftp_delete($ftp_stream, $file);
    }
    // Delete all the directories
    // Reverse sort the folders so the deepest directories are unset first
    rsort($folders);
    foreach ($folders as $folder) {
        ftp_rmdir($ftp_stream, $folder);
    }
    // Delete the final folder and return its status
    return ftp_rmdir($ftp_stream, $directory);
}
开发者ID:vortechs2000,项目名称:aidanlister-code,代码行数:64,代码来源:function.ftp_rmdirr.php


示例20: delete

 public function delete($file_path)
 {
     $result = ftp_delete($this->_connection_id, $file_path);
     if ($result) {
         return true;
     } else {
         $log = new \Kiva\Silverpop_Connector\Logger();
         $log->error("Failed to remove {$file_path} from FTP.");
         return false;
     }
 }
开发者ID:kiva,项目名称:silverpop_connector,代码行数:11,代码来源:FTPConnection.php



注:本文中的ftp_delete函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ftp_exec函数代码示例发布时间:2022-05-15
下一篇:
PHP ftp_connect函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap