i want to fix the image size, becaz if image size is too large then it will take more loading time so i have to reduce that. someone help me to do image scaling method. if size of image width is 800px and i want it in 300px width what should i do for that while uploading

Recommended Answers

All 4 Replies

How are you uploading? Some upload tools resize for you. If you programmed this yourself, use GD or Imagick to resize.

i have no idea about that. if i upload any size of image and i need to fix that image size

$uploadDir = '/upimg/videoimg/';

$imagename = $_FILES['videoimage']['name'];
$tmpname = $_FILES['videoimage']['tmp_name'];

$filePath = $uploadDir . $imagename;
$result = move_uploaded_file($tmpname, $filePath);

$myInputs = $_POST["videopath"];
$sql = mysql_query("INSERT INTO homepage_video_ads (videoImage,videoPath,Date)VALUES ('$imagename','$myInputs',NOW())");

ok thanks pritaeas,
i will try this

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.