Copying one album from one server to another

rwilson

Joined: 2002-09-18
Posts: 8
Posted: Thu, 2002-09-19 01:38

I'd like to copy an album from one server to another. I've created a blank album and click the add photos link and enter the URL in the form http://www.server.com/modules/gallery/album28. This shows a list of the thumbnails only. Do you have any ideas why?

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sat, 2002-09-21 07:52

Yes, because you're telling Gallery to copy all the images from a page which only displays thumbnails.

For example, if you enter this URL:

http://www.menalto.com/photos/cole-earlydays

Gallery will only load the images that you yourself would see if you entered
that URL into a web browser.

However, if you enter the actual path to the album directory containing
the images (ie, http://www.server.com/albums/album28) you'd get a
directory listing of the image, thumbnail, resize, etc. Gallery would be
able to parse that and let you load all the images.

 
rwilson

Joined: 2002-09-18
Posts: 8
Posted: Sat, 2002-09-21 12:59

Thanks. After posting the message, I realized what was going on. I had tried the URL to the album, but security is setup such that the server won't display directory contents. I'll disable this for a bit until the album is transferred.

Thanks again,
Robert

 
CarpetBagger
CarpetBagger's picture

Joined: 2002-08-09
Posts: 49
Posted: Sat, 2002-09-21 18:18

Web Servers should never be left configured to display all files in a directory. It's a security risk in too many cases. What you can do though is write a small PHP script that will display a list of the available images, put it in the Album you want to copy, then call the script in your URL.

For example, here is a VERY plain script that will display all files (no directories) as links.

<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE><HTML>
<HEAD>
<TITLE>Uploads for Gallery</TITLE>
<BODY><UL>
<?
$current=getcwd();
/* chdir($headdir); */
$handle=opendir(".");
while ($file = readdir($handle)) {
if(is_file($file)) if($file!="index.php") echo "<LI><A HREF=$file>$file</a><br>";
}
closedir($handle);
chdir($current);
?></UL>
</BODY>
</HTML></TD></TR></TABLE><!-- BBCode End -->

If you put that code in a file called FList.php, then you would call it as http://yoursite/album/albumname/FList.php

I used to use that code so that I could FTP files up to my FTP server, then have gallery process them into the Albums on my WWW server.

 
rwilson

Joined: 2002-09-18
Posts: 8
Posted: Sat, 2002-09-21 19:46

Thanks! This should work nicely.

Robert

 
rwilson

Joined: 2002-09-18
Posts: 8
Posted: Sun, 2002-09-22 13:58

Here is a version that should list only the original files.
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>
<HTML>
<HEAD>
<TITLE>Uploads for Gallery</TITLE>
<BODY><UL>
<?
$current=getcwd();
$handle=opendir(".");
while ($file = readdir($handle)) {
if(is_file($file) &amp;&amp; isFileType($file) &amp;&amp; !isGFile($file)) {
$fileArray[count($fileArray)] = $file;
}
}
closedir($handle);
chdir($current);
if (isset($fileArray)) {
sort($fileArray);
while (list($key, $val) = each($fileArray)) {
echo "<LI><A HREF=$val>$val</A></LI>";
}
}else{
echo "No images or movie files here.";
};
function isFileType($file) {
return (ereg(".jpg",$file) ||
ereg(".jpeg",$file) ||
ereg(".avi",$file) ||
ereg(".gif",$file) ||
ereg(".png",$file) ||
ereg(".mpg",$file) ||
ereg(".mpeg",$file) ||
ereg("wmv",$file) ||
ereg(".mov",$file));
}
function isGFile($file) {
return (ereg("sized",$file) ||
ereg("thumb",$file) ||
ereg("highlight",$file));
}
?></UL>
</BODY>
</HTML></TD></TR></TABLE><!-- BBCode End -->