Page 1 of 1

quick question about FTP uploading

Posted: Wed Nov 08, 2006 11:28 pm
by Ashmae
is there a way to copy through FTP? I am installing Serendipity installation files into 50 other folders but when I try a copy command through cuteFTP it says negetive.

Or am I going to have to upload these files and directories to each folder on the webserver one at a time :(

Posted: Thu Nov 09, 2006 8:29 am
by lordcoffee
As I know you can not copy. But you can copy it on your harddrive with the whole folder structure and then upload everything.

Greetings, lordcoffee

Posted: Thu Nov 09, 2006 4:04 pm
by judebert
There is no copy in FTP. You would need telnet or ssh access for that.

You could consider a little PHP script, though. First, you'll want to modify the zip to remove the serendipity/ directory tree. Then rearchive it in a format your server will understand (probably .tar.gz, although some support zip).

Now you've got an archive, hopefully compressed, with all the files in the top directory. Upload it to your webserver in a directory accessible to the webserver.

Now make a PHP script like this:

Code: Select all

<HEAD><TITLE>UNZIP</TITLE></HEAD>
<BODY>
<B>Unzipping Serendipity</B>
<pre>
<?php
system('/usr/local/bin/unzip ../serendipity.zip');
?>
</pre>
Finished.
</BODY>
You'll have to modify /usr/local/bin/unzip to point to your dearchiving command ('/usr/bin/tar -xvzf' for instance) and you'll have to modify ../serendipity.zip to point to the global copy of the archive (maybe you have to back up two directories, or go to ../archive/serendipity.tgz, or whatever you named it). If you're having trouble finding the unzip program, you can change the system command to 'which unzip', 'which tar', or even 'find / -name "unzip"'.

Save that with a name like unzip.php.

Now make the directories you want to install Serendipity in. FTP the unzip.php into each directory. CHMOD it to executable for your webserver (777 usually works).

In your browser, type the URL for the unzip.php (something like thedomain/thedirectory/unzip.php). Wait. Serendipity unzips, and reports what it's done. It should have all the Serendipity files in the top level of that directory. (If you want a serendipity/ subdirectory, just don't remove it during the rearchiving step.)

Serendipity is now ready to be installed, creating its databases, configuration, and .htaccess files.

Remove the unzip.php file to prevent others from overwriting your customized installation with the default files.

That's how I install my debug copies on my server.

Posted: Thu Nov 09, 2006 6:43 pm
by Ashmae
Both great info... Thanks for the help!