a discussion

How Zip Archive Upload Could Work

You've got a lot of images (or documents or whatever, someday).
You've got an empty gallery.
What to do?
Zip them up, of course!

Image->save(), er File->save() I mean, must be capable of handling a Zip archive of images (files) that will be unpacked on the server and saved as a series of new images (files) that all have settings as indicated on the create image (object) form.

To run with the image example:
Unpack the archive into a temp directory (using unzip -j to junk the directory structure of the archive...)
For each (tested) image file in that temp directory, create a new Image object.
Assign post data to new Image.
Generate a name.
Assign imagesize data to new Image.
Insert the Image record.
Move the file to the appropriate place.
Generate confirmation line for output.
Continue.
This could be coded as part of the image-save-writer-html context, but maybe it's more fun to make it part of Image->save() so that it can get moved to File->save() in the next version.

By Chris Snyder on January 10, 2003 at 1:24am

jump to top