At 12:35 23/11/01 +0000, [EMAIL PROTECTED] wrote:
>I'm working on a web application which will allow people to select and 
>download pictures from a photo library.
>
>As it stands at the moment, it uses ColdFusion on a Windows 2000 box to 
>copy files into the ftp directory of a Linux (Mandrake 8.1) server. This 
>works, but it means big tiff files zooming around our network.
>
>We'd like to be able to put the actual image files on the Linux box, and 
>then, when they are requested, simply put a link to the required files in 
>the FTP directory. Is there any reasonably straightforward way of creating 
>these links remotely over the web?

So you want to render the ftp directory listing into a neater HTML page? 
This was discussed on the PHP_UK list recently and someone pointed out a 
free piece of code to do exactly that (with PHP). Unfortunately my copy of 
the post has been binned but ISR that Yahoo groups keep a history. It's a 
fairly trivial bit of code to write anyway - I'd be tempted to use awk in a 
CGI script....something like...

#!/bin/bash
MDIR=`echo $QUERY_STRING | cut -f2 -d'='`
# might want to add checks for '..' etc here - you certainly
# don't want to run this on a public facing server
ls $MDIR | awk 'BEGIN { print "<body>" }
         /!^\./ {
                         print "<a href=\"" $0 "\">" $0 "</a><br>\n"
                 }
         END { print "</body>" }'




Blowing my own trumpet again, PushSite now works on Windoze with CygWin 
(http://homepage.ntlworld.com/colin.mckinnon/colin/programs/myprogs/pushsite/)

BTW if the images are in Tiff format, why don't you just access them via 
HTTP to solve your FTP permissions problem?

Colin

--------------------------------------------------------------------
http://www.lug.org.uk                   http://www.linuxportal.co.uk
http://www.linuxjob.co.uk               http://www.linuxshop.co.uk
--------------------------------------------------------------------

Reply via email to