0

I have simple registration form with an option to upload one's image after cropping.I am using the example found at

http://jsfiddle.net/w1Lh4w2t/

In the javascript section, on form submit they are converting the cropped image into blob and later sending it to 'whatever.php'

formData.append("cropped_image[]", blob);

My question is, in the 'whatever.php' page how do i capture the blob and use it to convert into an image and save in a folder on the server. Please help

Cyber Space
  • 53
  • 1
  • 1
  • 8
  • 1
    Possible duplicate of [Php : Convert a blob into an image file](https://stackoverflow.com/questions/6106470/php-convert-a-blob-into-an-image-file) – Axnyff Sep 24 '17 at 18:32
  • Thanks for the above link.I have a question though.In my case, how do i capture the $_POST variable containing the blob.When i do echo $_POST['cropped_image[]']; it says cropped_image[] is undefined index.What is the correct way to do this.I am confused a bit.Please help – Cyber Space Sep 24 '17 at 18:40
  • What happens if you print_r $_POST? – Axnyff Sep 24 '17 at 18:50
  • It says unexpected parse error, print_r $_POST(T_VARIABLE) – Cyber Space Sep 24 '17 at 18:55
  • You should use parens: `print_r($_POST);` – Axnyff Sep 24 '17 at 19:00
  • Hmm.....now it shows empty {} meaning nothing is getting sent to whatever.php page.Any ideas why its showing empty.Can you study the jsfiddle example for me? – Cyber Space Sep 24 '17 at 19:06
  • @CyberSpace you have to take a look at the `$_FILES` array. There you should find your file. – Joshua K Sep 24 '17 at 23:34

0 Answers0