ambo Posted January 9, 2009 Share Posted January 9, 2009 Hey guys i have a script that uploads and displays pictures but i have stored them in a database now i was wondering if it is possible to resize the picture before it gets uploaded UPLOADER CODE if(isset($_POST['upload']) && $_FILES['userfile']['size'] > 0) { $fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type']; $fp = fopen($tmpName, 'r'); $content = fread($fp, filesize($tmpName)); $content = addslashes($content); fclose($fp); $user = $session->username; if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); } $SET = "UPDATE images SET id ='$user', name='$fileName', size='$fileSize', type='$fileType', content='$content'"; mysql_query($SET) or die('Error, query failed'); echo "<br>File $fileName uploaded<br>"; } Link to comment https://forums.phpfreaks.com/topic/140176-solved-image-resize/ Share on other sites More sharing options...
rhodesa Posted January 9, 2009 Share Posted January 9, 2009 here is some info on image resizing in php: http://letmegooglethatforyou.com/?q=php+image+resize Link to comment https://forums.phpfreaks.com/topic/140176-solved-image-resize/#findComment-733516 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.