Skip to content
Advertisement

html2canvas capturing div image

im working on my wordpress site in which i want a div to be converted to image.. im using html2canvas javascript and it works perfect. when i capture a post it saves it to the server has “Captured.jpg”. all good till here.. but when i click capture again on a different post it replaces the previous image “captured.jpg”. i want all the images of the posts that i capture to be saved on server with post names may be? is it possible?

Header

JavaScript

Results.php

JavaScript

captured.jpg is saved.

single.php

JavaScript

is there any way if i trigger the capture for a post to save in a different name or post name or post id.. so it saves it to the server without replacing the old?

thanks

Advertisement

Answer

Result.php

Simple change the file name as below:

$File = "screens/" . time() . ".jpg";

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement