cgrant Posted February 19, 2010 Share Posted February 19, 2010 below is a working php script to make thumbnails and larger image can someone help me implement a progress loading bar? thanks <form action="<?php echo $_server['php-self']; ?>" method="post" enctype="multipart/form-data" id="something" class="uniForm"> <input name="new_image" id="new_image" size="30" type="file" class="fileUpload" /> <button name="submitimg" type="submitimg" class="submitButton">Upload/Resize Image</button> </form> <?php if(isset($_POST['submitimg'])){ if (isset ($_FILES['new_image'])){ $imagename = $_FILES['new_image']['name']; $source = $_FILES['new_image']['tmp_name']; $target = "photos/".$imagename; move_uploaded_file($source, $target); $imagepath = $imagename; $save = "photos/" . $imagepath; //This is the new file you saving $file = "photos/" . $imagepath; //This is the original file list($width, $height) = getimagesize($file) ; $modheight = 350; $diff = $height / $modheight; $modwidth = $width / $diff; $tn = imagecreatetruecolor($modwidth, $modheight) ; $image = imagecreatefromjpeg($file) ; imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ; imagejpeg($tn, $save, 100) ; $save = "photos/thumbs/" . $imagepath; //This is the new file you saving $file = "photos/" . $imagepath; //This is the original file list($width, $height) = getimagesize($file) ; $modheight = 100; $diff = $height / $modheight; $modwidth = $width / $diff; $tn = imagecreatetruecolor($modwidth, $modheight) ; $image = imagecreatefromjpeg($file) ; imagecopyresampled($tn, $image, 0, 0, 0, 0,$modwidth, $modheight, $width, $height) ; imagejpeg($tn, $save, 100) ; echo "Large image: <img src='photos/".$imagepath."'><br>"; echo "Thumbnail: <img src='photos/thumbs/".$imagepath."'>"; } } ?> I am new with php so if someone can help it would be great, I am just looking for a very simple progress bar Link to comment https://forums.phpfreaks.com/topic/192679-how-to-add-a-progress-bar/ Share on other sites More sharing options...
ohdang888 Posted February 19, 2010 Share Posted February 19, 2010 this isn't a php issue...its javascript, css or html nevertheless, jqueryUI provides a sufficient progress bar http://jqueryui.com/demos/progressbar/ Link to comment https://forums.phpfreaks.com/topic/192679-how-to-add-a-progress-bar/#findComment-1015039 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.