orangers Posted February 23, 2013 Share Posted February 23, 2013 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; } Quote Link to comment Share on other sites More sharing options...
denno020 Posted February 23, 2013 Share Posted February 23, 2013 Here you go You'll learn everything you need to know about image resizing using php. Quote Link to comment Share on other sites More sharing options...
Barand Posted February 23, 2013 Share Posted February 23, 2013 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.