php ftp

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kassim
Forum Newbie
Posts: 2
Joined: Mon Feb 07, 2005 5:21 pm
Location: uk

php ftp

Post by kassim »

Is there anybody out there that can help with the following problem?!
:?:

I need a function that when called will created a directory and two files within that directory. At the same the files must be written to.

Would you need multiple connections or can this be done with just one connection?

Also I need a recursive function that will delete all files within a given directory and then the directory itself.

All this has to be done using php FTP functions. Your help is really appreciated!

Thanks :D
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

1) You're probably going to get more help if you actually try it yourself, and ask about particular difficulties you're having, rather than trying to get someone to do it for you.

2) If you do want someone to do it for you, this should be posted in either the 'Volunteer Work' (free) or 'Job Hunt' (pay someone to do it) forum
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

have you checked

php.net/ftp, php.net/rmdir, php.net/unlink
Last edited by John Cartwright on Mon Feb 07, 2005 5:55 pm, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it can be done through a single connection. Although I don't know if you can dynamically write to the files being placed on the server...

As for recursive deleting.. it's fairly simple.. you make a list of all files recursively, unlink() each one, then rmdir() all the folders you passed through grabbing all the files. We've talked multiple times about recursing directory structures..
kassim
Forum Newbie
Posts: 2
Joined: Mon Feb 07, 2005 5:21 pm
Location: uk

Post by kassim »

pickle wrote:1) You're probably going to get more help if you actually try it yourself, and ask about particular difficulties you're having, rather than trying to get someone to do it for you.

2) If you do want someone to do it for you, this should be posted in either the 'Volunteer Work' (free) or 'Job Hunt' (pay someone to do it) forum
Thanks, that was very helpful!! (fyi - sarcasm) Attempts were made and eventually it was successful with minor changes to the end product. Please let me know if you need some help too. I have a mail box full of useless replies if required.

My thanks to the other members for their useful input.
Post Reply