本文整理汇总了PHP中ftp_delete函数的典型用法代码示例。如果您正苦于以下问题:PHP ftp_delete函数的具体用法?PHP ftp_delete怎么用?PHP ftp_delete使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ftp_delete函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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;
}
示例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']);
}
}
}
示例4: del
public function del($file)
{
if (!$this->connect_id) {
return false;
}
return ftp_delete($this->connect_id, $file);
}
示例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;
}
示例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;
}
示例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');
}
}
示例8: del_file
function del_file($path)
{
$this->off = @ftp_delete($this->conn_id, $path);
if (!$this->off) {
echo "文件删除失败,请检查权限及路径是否正确!";
}
}
示例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);
}
}
}
}
}
示例10: mdelete
function mdelete($path)
{
if (!$this->conn_id) {
return false;
}
return @ftp_delete($this->conn_id, $path);
}
示例11: delete
function delete($filename)
{
if (!@ftp_delete($this->ftp_conn, $filename)) {
$this->error[] = "Could not delete {$filename}";
return false;
}
return true;
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例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);
}