adobe photoshop 60 download

Adobe Premiere Pro CS5 discount free adobe dream weaver 8 download free download adobe distiller cheapest adobe photoshop free download full version where does adobe save download video files

adobe bridge download

Adobe Creative Suite 4 for Mac buy cheap download adobe photoshop elements 5 adobe download free premiere pro buy cheap adobe acrobat 8 download purchase adobe photoshop cs3 extended full download

free adobe download manager

buy cheap Adobe cs5 Design Premium for Mac adobe acrobat reader 6 0 1 free download adobe flashplayer download softpedia discount download adobe after effects download adobe after effects

free download adobe illustrator 9

cheapest Adobe cs5 for Mac adobe cs2 download free crack key generator how to download adobe flash movies cheapest adobe acrobat reader free download adobe 8 free download

free adobe download

Autodesk AutoCAD cheapest adobe download free premiere adobe distiller free download discount download adobe flashplayer free adobe download manager download

adobe audition 1 5 download

cheap AutoCAD Architecture adobe acrobat 8 free download adobe creative suite 2 download cheapest download adobe premiere pro cs3 download adobe reader cd

adobe encore menu download

cheapest Adobe Captivate CS5.5 download adobe ebook reader adobe photoshop elements 3 for mac download cheap download adobe photoshop 7 download adobe flash player

download adobe reader latest version

discount Creative Suite 5.5 download adobe photoshop cs2 adobe photoshop 8 free download full version discount download free adobe standard adobe flas player 9 download

download adobe photoshop mac free

Autodesk AutoCAD discount free adobe 8 download free download of adobe pagemaker buy cheap adobe dream weaver 8 download download adobe scanner

adobe reader download for mac

discount AutoCAD 2010 free adobe download free download of adobe reader buy cheap free download adobe photodeluxe home edition adobe flash player 8 download

adobe lightroom download

AutoCAD LT 2012 buy cheap adobe golive cs2 download freeware adobe acrobat download cheap adobe flash activex download download adobe flashplayer

adobe flash 9 download

adobe acrobat x buy cheap adobe free download software download adobe photoshop cs2 cheap download adobe audition 3 free adobe premiere download

adobe flash offline download

adobe creative suite 5 discount download adobe acrobat reader 8 adobe 9 download discount free adobe photoshop elements 6 download download adobe reader pdf free

search adobe reader 7 0 download

cheap adobe cs5 adobe acrobat writer free download adobe fine reader free download cheap adobe player download center adobe professional download

download adobe flashplayer free

Adobe cs5 Design Premium cheapest where free download adobe acrobat free download of adobe reader buy cheap adobe flash 7 download download adobe reader8

free adobe acrobat writer download

Adobe eLearning Suite cheap download adobe active x download adobe acrobat 7 updates discount download adobe flash 9 for h264 free adobe pdf maker download

adobe photo plus 6 download

discount Adobe eLearning Suite 2 download adobe photoshop cs2 adobe illustrator full crack download cheapest adobe photoshop download site adobe acrobat raeder v7 download

adobe flash player download for windows vista

discount Adobe Flash Catalyst CS5 adobe photo editor download adobe reader 6 free download discount download adobe flashplayer free free download adobe illustrator 9

adobe shockwave player download

discount Adobe Indesign CS5 free adobe dream weaver 8 download adobe photo free download cheapest adobe flash player downloader free download hunter grabber free adobe profesional 8 download

adobe type manager download free

discount Adobe Photoshop CS5 download adobe acrobat reader free old adobe software download discount download adobe flash player stand alone adobe acrobat update download

Thumbnail Creation using uploadify.php

Hello friends i came across a good jquery flash file up-loader here . Do use it its simple and powerful .

The next main thing was generation of thumbnail using the same flash uploader after some homework found a solution for it . Do some simple updations in your existing code .

1. Create a folder named “thumbnails” under the upload folder .

2. Replace the code in uploadify.php [you can find it under scripts folder] with the following code .


if (!empty($_FILES))
{
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
$targetFile =  str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
move_uploaded_file($tempFile,$targetFile);
echo "1";
}
$imgsize = getimagesize($targetFile);
switch(strtolower(substr($targetFile, -3)))
{
case "jpg":
$image = imagecreatefromjpeg($targetFile);
break;
case "png":
$image = imagecreatefrompng($targetFile);
break;
case "gif":
$image = imagecreatefromgif($targetFile);
break;
default:
exit;
break;
}

$width = 80; //New width of image
$height = $imgsize[1]/$imgsize[0]*$width; //This maintains proportions

$src_w = $imgsize[0];
$src_h = $imgsize[1];

$picture = imagecreatetruecolor($width, $height);
imagealphablending($picture, false);
imagesavealpha($picture, true);
$bool = imagecopyresampled($picture, $image, 0, 0, 0, 0, $width, $height, $src_w, $src_h);

if($bool)
{
switch(strtolower(substr($targetFile, -3)))
{
case "jpg":
header("Content-Type: image/jpeg");
$bool2 = imagejpeg($picture,$targetPath."thumbnails/".$_FILES['Filedata']['name'],80);
break;
case "png":
header("Content-Type: image/png");
imagepng($picture,$targetPath."thumbnails/".$_FILES['Filedata']['name']);
break;
case "gif":
header("Content-Type: image/gif");
imagegif($picture,$targetPath."thumbnails/".$_FILES['Filedata']['name']);
break;
}
}

imagedestroy($picture);
imagedestroy($image);

echo '1';

You are done ! Hope it helped you .

About the Author: a holistic web developer , movie buff and technical blogger from queen of arabian sea.

RSSComments (13)

Leave a Reply | Trackback URL

  1. teerapong says:

    it’s well, i will to do it but not work;

    now, i’m trying to do from your example;

    i hope it work

    oh! i use multiupload : true . Is it support?

  2. anoopsachari says:

    @teerapong yes , its supports multiupload.

  3. Ian Loats says:

    Hello Achari
    Your code is very helpful!
    But, is it possible to specify the Height rather than the Width? If so, how would that be done?

    TIA

  4. Ian Loats says:

    sorry, done, i just changed this…

    $height = 130; //New height of image
    $width = $imgsize[0]/$imgsize[1]*$height; //This maintains proportions

    $src_h = $imgsize[1];
    $src_w = $imgsize[0];

  5. anoopsachari says:

    @Ian Loats Thankyou for your update . i would check and include it in my code . :)

  6. Ple says:

    Nice Code.. thanks

  7. Isaac says:

    Thanks a lot you are the best my friend

  8. James says:

    Will this work with pdf files or do changes need to be made? If changes need made, what would they be. Thanks!

  9. Balaji says:

    sir i create post command in my web site .

    pls send the correct coding in mail.

    pls.

    by balaji
    tamil nadu??

  10. Reiko81 says:

    Wonderful script!
    But… If I want a squared thumbnail?
    How can I crop the image?

  11. ramesh says:

    Hi I don’t know abt PHP but I’m working with asp.net can you place the same script for asp.net too so that it might help me and even other too.

    Thanks once again.

  12. Fabrizio says:

    Hi, nice script but i have a problem:

    your script doesn’t rotate image (i get thumbs even horizontal also when the image are vertical)

    i’ll try to fix it in this way:

    $src_w = $imgsize[0];
    $src_h = $imgsize[1];

    $width = $src_w * 0.20; //20% of the orig image
    $height = $src_h * 0.20; //20% of the orig image

    $picture = imagecreatetruecolor($width, $height);
    imagealphablending($picture, false);
    imagesavealpha($picture, true);
    $bool = imagecopyresampled($picture, $image, 0, 0, 0, 0, $width, $height, $src_w, $src_h);

    but doesn’t work :(
    any idea how can i solve this? thank you

  13. preethi says:

    yaa..its really working!!!!

Leave a Reply

Get Adobe Flash playerPlugin by wpburn.com wordpress themes