Damian SIlvera
Damian SIlvera

Reputation: 866

Set image data into input file tag

I have a string code in a javascript variable that i get from cropit plugin (plugin to crop images). Is there any way to set this info into an input file tag to send it then by ajax to php?

This is the code i have in javascript and how i get it from the image:

  var imageData = $('.image-editor').cropit('export');

this variable is something like this: http://encargaya.com/imagefile.txt

Upvotes: 2

Views: 540

Answers (1)

Bryant Miano
Bryant Miano

Reputation: 689

You should just dump that base64 string into a hidden input and POST with that. It's unnecessary to try and put it in an input file tag.

Upvotes: 3

Related Questions