E
E
erkaim2018-02-02 20:51:59
PHP
erkaim, 2018-02-02 20:51:59

I connected a lib for cropping the picture, how can I upload the image to the site now?

There are such libs

https://mattketmo.github.io/darkroomjs/
scottcheng.github.io/cropit

How to upload images to the server now?

So that you can pick them up in the $_FILES variable?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2018-02-02
@402d

through $_FILES in any way.
see https://github.com/MattKetmo/darkroomjs
save: {
callback: function() {
this.darkroom.selfDestroy(); // Cleanup
var newImage = dkrm.canvas.toDataURL();
this variable contains the
string data:image/jpeg;base64,/9j/4AAQSkZJ
it can be passed to the server .
write a script that will accept it. parse and save to the right place,
but if you know js better than php, then you can
collect the correct post request to the server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question