0

I found a script - Upload and Crop image on this website http://onlinewebapplication.com/2011/08/image-upload-cropping-php-jquery.html Everything works fine, but I need to add my new name for new images...

When I upload an image -> before crop I can change file name, but it works only for big images, for thumb I don't have an idea because the variables are sent by AJAX.

My version works here - link first input is for file path, second for new filename..

I need change name for big image and thumb, but it works only for big. How send variable "image_name" to ajax_image.php ?

Anyone ? Please help me, I need this ..Thanks

3
  • The thumbs are generated as "small" . $username . ".jpg". what do you want to change? Commented Oct 22, 2011 at 18:09
  • I want change $username to variable from form Commented Oct 22, 2011 at 18:25
  • Firebug works well if you want to see what gets submitted by your AJAX script :) Commented Oct 22, 2011 at 19:35

1 Answer 1

1

You can change the name for the big image in this line:

$actual_image_name = time().substr($txt, 5).".".$ext;

and for the small image you can pass the name as parameter by changing this:

url:"ajax_image.php?t=ajax&img="+$("#image_name").val()+"&w="...etc

to this:

url:"ajax_image.php?sname=blabla&t=ajax&img="+$("#image_name").val()+"&w="...etc

also for the small image again change in ajax_image.php this:

$new_name = "small".$session_id.".jpg"; // Thumbnail image name

to this:

$new_name = "smallqa".$_GET['sname'].".jpg"; // Thumbnail image name
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.