473,728 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Delete ftp-folder created via php installation?

Hi,

how do I delete a folder at my ftp-server, that was automatically
created through a installation script? I dont have the permission to
delete that folder :-(

Thx for your help

Alf

P.S.
I have already found the following script, but I dont know where exactly
do I need to execute it:

---------------------------------------------------
<?php
function delete($file) {
chmod($file,077 7);
if (is_dir($file)) {
$handle = opendir($file);
while($filename = readdir($handle )) {
if ($filename != "." && $filename != "..") {
delete($file."/".$filename );
}
}
closedir($handl e);
rmdir($file);
} else {
unlink($file);
}
}

delete("folderr name");
-------------------------------------------------

....whereas foldername at the end is the folder to be deleted.
?>
Jul 17 '05 #1
3 2705
Alf Laue wrote:
how do I delete a folder at my ftp-server, that was automatically
created through a installation script? I dont have the permission to
delete that folder :-(


When the site is hosted on a *nix server, the easiest way to remove the
folder is through exec():

exec('rm -r foldername');
JW

Jul 17 '05 #2
Janwillem Borleffs wrote:
Alf Laue wrote:
how do I delete a folder at my ftp-server, that was automatically
created through a installation script? I dont have the permission to
delete that folder :-(

When the site is hosted on a *nix server, the easiest way to remove the
folder is through exec():

exec('rm -r foldername');
JW

just because your ISP has set up an ftp directory doesn't mean you have
to use it - just let it sit there.
Jul 17 '05 #3
here is what i use
<?
$path = '/path/to/folder/;

$cmd = "rm -rf $path";

`$cmd`;

?>

"noSpam" <ga*****@nowher e.qwerty.no.spa m.address.com> wrote in message
news:Px******** **********@fe1. news.blueyonder .co.uk...
Janwillem Borleffs wrote:
Alf Laue wrote:
how do I delete a folder at my ftp-server, that was automatically
created through a installation script? I dont have the permission to
delete that folder :-(

When the site is hosted on a *nix server, the easiest way to remove the
folder is through exec():

exec('rm -r foldername');
JW

just because your ISP has set up an ftp directory doesn't mean you have to
use it - just let it sit there.

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1721
by: Peter A. Schott | last post by:
If I want to verify that a file has finished writing before deleting the remote file, what would be the best method? Current code on Python 2.4: #filename - remote FTP server File Name #NewFile - local file copy of the remote file #objFTP - standard ftplib.FTP object NewFile = open(os.path.join(InputPath, RemoteFileName), "wb")
1
1550
by: Jason S. | last post by:
I have an app in which I want to remove a directory on disk. The below code works just fine unless there is a user logged in through the FTP site to this directory. string sFtpPath = @"C:\SomeFTPpath"; DirectoryInfo di = new DirectoryInfo(sFtpPath); di.Delete(true); I have even successfully removed the virtual directory from the FTP site that references this path but I can't seem to find a way to kick a user out
11
454
by: Viviana Vc | last post by:
Hi all, I would like to delete from a directory all the files that match: bar*.* I know that I could do for instance: system("del bar*.*"), but this will bring up the command prompt window and as my app is a winmain app this wouldn't be nice. I could use DeleteFile, but you can not use wildcards in this one. How could I do this using Windows functions?
2
1524
by: Mark | last post by:
Here is what I am hoping to accomplish: 1. Connect to FTP server - I can do this. 2. Download file contained in the directory that I connect to. 3. Delete file contained on the ftp server. 4. Repeat steps 2 and 3 until all files are out of there. Can anyone give me any direction on this? I know how to download a file if I know the name of it before starting but I don't know how to download a file and then delete that file from the...
5
3501
by: Sam777 | last post by:
I was under the impression that creating the app_offline.htm file at the root of the webapp would cause all handles to be closed so that the app could be removed. Unfortunately, this isn't the case. One handle remains open. Debugging shows that it's actually the IIS cache and not ASP.NET that owns this handle. During IIS shutdown, the handle is closed with the following stack trace: ChildEBP RetAddr 0006fbe4 5a403e05...
5
7253
by: T | last post by:
I connect to a FTP server which can be either unix or windows server. Once in the FTP session, I would like to delete a directory tree on the server. Is there a command that will do this? If not, can someone point me to a right direction? Thanks!
1
2434
by: Drew | last post by:
Hi all I'm fairly new to python so please forgive my lack of comprehension of the obvious. I'm writing a script to ftp files to a server. This script will run weekly. Part of the script first deletes the previous weeks files. The problem is I'm never sure of the exact number and full name of the files that need to be deleted. All the files start with the same string but have different extensions (eg drew.1 drew.2 drew.tmp drew.hlp). So...
2
2285
coolgames
by: coolgames | last post by:
when i try to delete a file from my ftp, it says: (i couldn't access the FTP trough "windows explorer" i had to use www.ftpglobal.com) Warning: ftp_delete() : Permission denied on server. You are restricted to your account. in /home/random9/public_html/includes/filesystem.inc.php on line 415 Warning: ftp_chdir() : Permission denied on server. You are restricted to your account. in /home/random9/public_html/includes/filesystem.inc.php on...
1
3752
by: teo | last post by:
hallo I'm with vb net fx 2.0 vs2005 I'have difficulties to find some functions that allow me to delete and rename files and folders via FTP I'm good with My.Computer.Network.UploadFile
5
4264
by: maheswaran | last post by:
Hi, i have issue in FTP , i have tried with .net and also c# Note the following scenario: 1. Upload the file to FTP >than 60 MB. 2. At the time of Uploading, unplug the LAN cable (or) In system tray Right click on Local Area connection and select "Disable".
0
8758
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9422
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9277
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9130
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6716
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6013
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4524
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2663
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2161
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.