Zubrag.com
July 17, 2018, 09:21:21 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Multiply file thumb generator  (Read 8567 times)
web_master
Newbie
*
Posts: 1


« on: May 25, 2007, 10:53:55 PM »

The Thumb generator is great. I just want to ask how its work with multiply file upload? Ive upload the files like this:

if($_FILES["picture"]["name"][1]) {
$dest = "../photo_dir/".$document_id."_photo[1].jpg";
copy($_FILES["picture"]["tmp_name"][1], $dest);
}

if($_FILES["picture"]["name"][2]) {
$dest = "../photo_dir/".$document_id."_photo[2].jpg";
copy($_FILES["picture"]["tmp_name"][2], $dest);
}

what do I need to do to make a multiply thumbs to?

Logged
zubrag
Administrator
Hero Member
*****
Posts: 787


WWW
« Reply #1 on: May 26, 2007, 03:56:56 AM »

Update settings section in thumb.php to match your requirements (bypass $images_folder and thumbs_folder).

Now remove following code from thumb.php

if (isset($_REQUEST['src'])) {
  $from_name = urldecode($_REQUEST['src']);
}
else {
  die("Source file name must be specified.");
}

if (isset($_REQUEST['dest'])) {
  $to_name = urldecode($_REQUEST['dest']);
}
else if ($save_to_file) {
  die("Thumbnail file name must be specified.");
}

Finished thumb.php update.  And here is what you will have in your script

// include thumbnail generator functions
include('thumb.php');

if($_FILES["picture"]["name"][1]) {
$dest = "../photo_dir/".$document_id."_photo[1].jpg";
GenerateThumbFile($_FILES["picture"]["tmp_name"][1], $dest, $max_x, $max_y);
}

if($_FILES["picture"]["name"][2]) {
$dest = "../photo_dir/".$document_id."_photo[2].jpg";
GenerateThumbFile($_FILES["picture"]["tmp_name"][2], $dest, $max_x, $max_y);
}
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC