0

I'm using imgAreaSelect to select image area. I have following values.
Need Help to upload original image to "../original-images/" folder & cropped images to "../uploads/" folder.
Upload cropped images with new filename "$newfilename"
Plz help
Thanks in advance.

    $x1
    $y1
    $x2
    $y2
    $w
    $h

    $filename = $_FILES["image"]["name"];
    $file_basename = substr($filename, 0, strripos($filename, '.')); // get file extention
    $file_ext = substr($filename, strripos($filename, '.')); // get file name
    $newfilename =time().rand(11,99). md5($file_basename) . $file_ext;
3
Contributors
4
Replies
13
Views
1 Year
Discussion Span
Last Post by hrushi9
0
            $filename = $_FILES["image"]["name"];               
            $x1 = $_POST['x1'];         
            $y1 = $_POST['y1'];     
            $x2 = $_POST['x2'];             
            $y2 = $_POST['y2'];     
            $w = $_POST['w'];           
            $h = $_POST['h']; 

            $target_dir = "../uploads/"; 
            $path = "../original-images/"; 

            $jpeg_quality = 100;

            $file_basename = substr($filename, 0, strripos($filename, '.')); // get file extention

            $file_ext = substr($filename, strripos($filename, '.')); // get file name

            $target_file = time() . rand(11, 99). md5($file_basename)  . $file_ext; //rename file and add extention

Help please...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.