Page 1 of 1

ftp & php file upload

Posted: Sun Dec 19, 2004 8:55 am
by wapchimp
My web & php knowledge levels are failry low :oops:

OK I have just got a neat php file upload script working here;
http://www.wapchimp.pwp.blueyonder.co.uk/fileupload/

I have some questions;

Is there some way to move (copy/paste) files from one web directory to another, does an ftp server allow this because I can't seem to do it.

Is there any other way to move these files from the storage directory to another. I have php, mysql etc on my host.

The reason I ask is that I have broadband, and free unlimited storage & bandwidth etc with my web host. The only snag is I HAVE TO dial in to their ftp server or I cannot access it. Hence the need for a php file upload to by-pass this. I just need to know if I can move these file around on the server.

Thanks for your help

mv shell command

Posted: Sun Dec 19, 2004 1:48 pm
by neophyte

Code: Select all

<?php
   exec("mv /absolute/path/to/file.txt /absolute/path/to/new/location/file.txt");
// If moving an entire directory it would be mv -R /paths/ /new/paths/
?>

Posted: Sun Dec 19, 2004 2:47 pm
by wapchimp
Thanks neophyte

Where exactly do I put this code?

Thanks

Posted: Sun Dec 19, 2004 3:06 pm
by neophyte
In a file: something.php
Upload the file to the server and then go to it with your browser.

:roll:

Posted: Sun Dec 19, 2004 4:13 pm
by wapchimp
8O
theres me thinking it would be tricky :oops:

cheers