PDA

View Full Version : Bulk Upload to Exhibition


cultrix
29th of May 2002 (Wed), 21:06
Hi,
I just downloaded the EE. Really love it. This is what I was looking for. I have a small question. I want to create a huge album with about 320 photos. I dont want to add any text in this case. Is there a way to do a bulk add ? I looked at the database structure. I know I can set up a series of inserts into the database directly by generating the insert statements in a script but I have to figure out the relations and add them in that order. So has any body done something like that? Any body has a utility to do this ? Or am I being too naive to think I can achieve bulk upload by a series of inserts?

Prahalad

Pekka
30th of May 2002 (Thu), 05:40
I hope to have a bulk resize/upload solution ready in two-three weeks.

It's not very straightforward to just insert photo into the database as bulk, one problem is that you need to know the filenames, exhibitions etc.
See selectphoto.php lines 31-246 for how I insert a photo into the database. Plus to that selectphoto.php brings you to thumbnailed filename selection which is essential.

If you like, I could try doing a simple insert utility to insert photos to the database, where filename and exhibition is taken from an array:

"1" => "newphoto1.jpg",
"1" => "newphoto2.jpg",
"2" => "newphoto3pg",
"1" => "newphoto4.jpg"

or just to one exhibition using a string

$upload = "newphoto1.jpg, newphoto2.jpg, newphoto7.jpg, newphoto12.jpg";

cultrix
30th of May 2002 (Thu), 06:13
Hi Pekka,
Thank you very much for the prompt reply. When I meant to insert into database directly I did not mean that I would do it in just one table. I studied the DB layout and was planning to do it in a manner that did not violate the referential integrity constraints.
What I was planning was something like this
create a new exhibition and add one photo manually then run a script with the following logic
---------------------
Open thumbnails folder
Get all file names
do until there are no more file names
insert into photo table
get photo id of newly inserted photo
insert into photo_to _exhibition
insert into photo_to_category
insert into photo_size
end do
------------------------------------
Does this logic sound OK?

Also if you are releasing a bulk upload facility in two/three weeks, I dont think it is prudent to spend time in a temporary solution. I really appreciate the offer :-) but really I am not in such a hurry and I can wait 2/3 weeks. Since it is only 2/3 weeks I will hold of on creating the script.