Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
dotcomtim  
#1 Posted : Wednesday, November 29, 2006 2:37:34 AM(UTC)
dotcomtim

Rank: Member

Groups: Member
Joined: 11/29/2006(UTC)
Posts: 14

Have a few questions setup up the PHP Upload Script.

1) Is there a sample of the script for uploading just the thumbnails and not the source file?

2) Has anyone attempted to rename the files? I have it set up to sort the photos in the order you want them uploaded and like to know how to rename them as photo1.jpg, photo2.jpg, photo3.jpg and so fourth.

3) Resizing, I have read that when resizing that it resizes based on width or height. Has this been changed in version 4? To resize exact: 400x270


This is what I have turned on for image thumbnails and unless I have UploadSourceFile to true nothing gets uploaded.

Code:
iu.addParam("UploadSourceFile", "false");
iu.addParam("UploadThumbnail1FitMode", "Fit");
iu.addParam("UploadThumbnail1Width", "400");
iu.addParam("UploadThumbnail1Height", "270");
iu.addParam("UploadThumbnail1JpegQuality", "60");
iu.addParam("UploadThumbnail1CopyExif", "false");

Edited by user Tuesday, February 19, 2008 4:54:18 PM(UTC)  | Reason: Not specified

Alex Makhov  
#2 Posted : Wednesday, November 29, 2006 2:03:14 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups:
Joined: 8/3/2003(UTC)
Posts: 998

Hello,

1)
Code:
iu.addParam("UploadSourceFile", "false");

2) Just change the following string in upload.php to what you want:
Code:
 move_uploaded_file($_FILES[$thumbnail1Field]['tmp_name'], $absGalleryPath . "/Thumbnails/" . $fileName . ".jpg"); 

For example to the following:
Code:
 move_uploaded_file($_FILES[$thumbnail1Field]['tmp_name'], $absGalleryPath . "/Thumbnails/" . "Photo" . $i . ".jpg"); 

3) If you use the specified code the original file is not uploaded but the first thumbnail does.
Sincerely yours,
Alex Makhov

UserPostedImage Follow Aurigma on Twitter!
dotcomtim  
#3 Posted : Wednesday, November 29, 2006 10:39:06 PM(UTC)
dotcomtim

Rank: Member

Groups: Member
Joined: 11/29/2006(UTC)
Posts: 14

Sorry, but just went way over my head..

This is what I have for the upload.php page.

Code:
$galleryPath = "../galleries/".$_POST['directory']."/photos/";
$absGalleryPath = realpath($galleryPath) . "/";
$fileCount = $_POST["FileCount"];

for ($i = 1; $i <= $fileCount; $i++)
{
  	$thumbnail1Field = "Thumbnail1_" . $i;
	$fileName = $_FILES[$thumbnail1Field]["name"];
	move_uploaded_file($_FILES[$thumbnail1Field]['tmp_name'], $absGalleryPath .'/'.'photo'.$i.'.jpg');
}


This is what I have for the UI in the galleryupload.php page.
Code:
iu.addParam("UploadSourceFile", "false");

As i don't want the originals..

Code:
iu.addParam("UploadThumbnail1FitMode", "Fit");
iu.addParam("UploadThumbnail1Width", "400");
iu.addParam("UploadThumbnail1Height", "270");

Images are resizing to 360x270 - can't figure why they won't resize to what I need 400x270. I am using a Canon Rebal to shot my photos and when I resize photoshop 400 it automatically puts 270.

Code:
iu.addParam("UploadThumbnail1JpegQuality", "40");
iu.addParam("UploadThumbnail1CopyExif", "false");


When I use the above only photo1.jpg gets uploaded, when I have 30 and need it to upload photo1.jpg, photo2.jpg, and so on.

Edited by user Tuesday, February 19, 2008 4:55:29 PM(UTC)  | Reason: Not specified

dotcomtim  
#4 Posted : Wednesday, November 29, 2006 10:51:14 PM(UTC)
dotcomtim

Rank: Member

Groups: Member
Joined: 11/29/2006(UTC)
Posts: 14

Even though right now I am able to upload one photo at a time, I also noticed that if I drag my photos into the upload window and sort them based on the order I want them.. The first photo is not the first photo in the list but the first photo based on order by name.. Thought I read it uploaded based on what order you place your photos?

IE:
Place my photos in to the upload window : 100_3749.JPG, 100_3760.JPG, 100_3780.JPG, 100_3781.JPG, 100_3782.JPG ...

Sort them in the order I want : 100_3780.JPG, 100_3781.JPG, 100_3749.JPG, 100_3760.JPG, 100_3782.JPG ...

Click to upload
photo1.jpg which should be 100_3780.JPG based on the order is actually 100_3749.JPG order based on numberic not my order after dragging into place.
dotcomtim  
#5 Posted : Friday, December 01, 2006 5:43:16 AM(UTC)
dotcomtim

Rank: Member

Groups: Member
Joined: 11/29/2006(UTC)
Posts: 14

Lets take this one step a time... starting with why I can not upload more than thumbnail photo at a time with UploadSourceFile turned off.

iu.addParam("UploadSourceFile", "false");

Using:
Code:
$galleryPath = "../galleries/".$_POST['directory']."/photos/";
$absGalleryPath = realpath($galleryPath) . "/";
$fileCount = $_POST["FileCount"];

for ($i = 1; $i <= $fileCount; $i++)
{
$thumbnail1Field = "Thumbnail1_" . $i;
$fileName = $_FILES[$thumbnail1Field]["name"];
move_uploaded_file($_FILES[$thumbnail1Field]['tmp_name'], $absGalleryPath .'/'.'photo'.$i.'.jpg');
}

Edited by user Tuesday, December 18, 2007 8:02:40 PM(UTC)  | Reason: Not specified

dotcomtim  
#6 Posted : Friday, December 01, 2006 6:07:25 AM(UTC)
dotcomtim

Rank: Member

Groups: Member
Joined: 11/29/2006(UTC)
Posts: 14

Ok scrap everything I just wrote, as I jus read in other posts it doesn't rename to what I am looking for. We have to manually rename them with php after uploading which is way beyond my knowledge.

Here is my next problem: If I can not rename my photos in the order my members would like to upload their photos.. I can go back to what I was doing before and that is to upload the photos already named and resized. So my next question is how would I go about making sure that the photos they are uploading are correct? Does it have this feature?

I'll need to check that when they upload they upload photo1.jpg, photo2.jpg, photo3.jpg and so forth, and they can't upload image1.jpg or if a photo (photo2.jpg) is missing it doesn't submit.

A feature I was using with JUPLOAD - www.jupload.biz

Thanks
Alex Makhov  
#7 Posted : Monday, December 04, 2006 6:39:26 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups:
Joined: 8/3/2003(UTC)
Posts: 998

Hello,

Please, check the value of FilesPerOnePackageCount Property parameter. It looks like you are uploading files one by one (FilesPerOnePackageCount=1).

Edited by user Tuesday, February 19, 2008 4:56:32 PM(UTC)  | Reason: Not specified

Sincerely yours,
Alex Makhov

UserPostedImage Follow Aurigma on Twitter!
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.