Jump to content

PHP THUMBNAILS CREATION


orangers

Recommended Posts

THE FOLLOWING CODE UPLOADS 5 IMAGES TO A FOLDER AND WRITES THE PATHS TO A DB.

I WANT TO CREATE THUMBNAILS OF THE UPLOADED IMAGES AND WRITE THE THUMBS

PATH TO A DB TOO. PLEASE HELP

 

if(isset($_POST['Submit']))

{

foreach ($_FILES as $file)

{

$fileName = $file['name'];

$tmpName = $file['tmp_name'];

$fileSize = $file['size'];

$fileType = $file['type'];

$ext = substr($fileName, strpos($fileName,'.'), strlen($fileName)+1);

 

if($fileName=="")

{

$filePath = '../../images/uploads/default.jpg';

}

else{

$filePath = $uploadDir . $fileName;

}

$filePath = str_replace(" ", "_", $filePath);

$result = move_uploaded_file($tmpName, $filePath);

if(!get_magic_quotes_gpc())

{

$fileName = addslashes($fileName);

$filePath = addslashes($filePath);

}

$fileinsert[]=$filePath;

}

Link to comment
https://forums.phpfreaks.com/topic/274849-php-thumbnails-creation/
Share on other sites

THE FOLLOWING CODE UPLOADS 5 IMAGES TO A FOLDER AND WRITES THE PATHS TO A DB.

I WANT TO CREATE THUMBNAILS OF THE UPLOADED IMAGES AND WRITE THE THUMBS

PATH TO A DB TOO. PLEASE HELP

 

1. Don't shout

 

2. Use [ code][ /code] tags

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.