Alex,
Amazing you should post this, since this is something I've been batting around for weeks, and have been working on.
The "problem" from an admin point of view, is housekeeping.
As links grows, so does the number of files (even logo files). A 20,000 link database could have 20,000 files... so how do you divide them up?
As I was thinking last night, I wondered if FTP would be the answer rather than HTML upload.
I was going to ask if there could be an admin upload feature, that uses NET:FTP to allow placement of the file in _any_ directory. FTP reqires a password, so the FTP session _should_ have the permissions of the user logged on, not the server, right? This would allow files to _not_ be listed as _nobody_ for FTP maint by the Admin, rather than super user. I don't konw NET:FTP well enough to know , but it would have to work that way, right?
There are problems with this, and permissions are the biggest problem.
Here's my needs, rather than my perspective, what's yours:
I run a gallery/postcards site from Links.
I need, for housekeeping reasons, to upload files to different directories, rather than one main upload.
My URL link is the link to the main image in the directory.
I'd like the height/width inserted into the database on upload. Possibly even size. (user selectable, but makes for faster html loading).
I'd like to automatically generate the thumbnail image in a directory /thumbnails under the directory where the main image is loaded.
Right now I also store the thumbnail image as a separate url, but it's ALWAYS /thumbnails in my case.
I have a good outside program that manipulates the file to create pretty awesome thumbnails.
There are all sorts of code snippits to return Ht/Wd/Sz
Now... moving files requires server permissions, or access via another means, but Links needs to have the ability to regenerate file/image links if the database gets moved around.
In your case, the ID.gif|jpg file is linked to the record by the ID number, and needs to be renamed on upload. This provides a good link.
Where to put the file?
Please.... when implementing this, allow the ability to modify your ID.ext format into the more robust gallery convention I need.
I'm looking at storing the filename (which will be unique, though not a number) with the Link Record, and in an images database storing the filename, it's characteristics (size, width, etc) _AND_ it's path location.
cron runs as root, so I can have a 'move' script to move the files to where they need to be, from the upload area, to the gallery tree. In my case I would need cron to check every 10-15 minutes, but if I automated my build, cron and my build, could run at night or x-times a day.
The logic:
The link record stores the image _name_ only. This image name is unique in the image database (either link ID or file name). If the link record has an image associated with it, on build, the program checks the image database for the characteristics of that image, and uses them to build the link.
That way, if the image data changes, it's reflected in the link the next build.
It also means I can rearrange the image tree, run a script on the image database to change the paths, and again, on the next build, links is updated.
You could even change all the sizes of the images with this plan, since Links doesn't store the image data, only the name, if you decide to change the format from 88x33 to 120x60 you can resize all existing images, change the image table size data, and rebuild links, and it's done.
Also, if the image data is kept in a different table, FTP and telnet could be used to manage the images and the image database, and then issue a rebuild command, and links is updated.
Are you following?
Alex, this is really important to me, as this is what I use links for, and I've put a lot of time into thinking about it.
Please keep me informed of your progress, and I'd ben happy to look at or test code in progress for problems.
I've been working on the design of the image manipulation routines, leaving the interface to links alone since that changes (as evidenced here) so maybe together we can create something that works "simply" and leaves all the hooks in for a heavy weight gallery management program.
thanks!!!!
==> by storing only the image name with the link, and everything else in the image table, it allows people to select their image indexing scheme -- they can use the link ID, the Link Name, an incremental name, their existing image-collection ID, etc. It's very flexible, yet simple.
------------------
Robert S. Pataki, MD
President, PUGDOG Enterprises, Inc.
www.postcards.com [This message has been edited by pugdog (edited September 02, 1999).]