I had a web page where the user could upload pictures and then draw on it. All the drawing stuff are programmed in javascript.
After a new release, we want to provide to the user a specific set of images via the url.
By exemple : www.mysite.php?UID=encrypted.ID.of.folder.stored.server.side
And the server side will give to js the pictures to use.
My question is : In which format should I send the pictures to the JS functions to treat them exactly like from a filePicker ?
My PHP looks like this
<?php
ini_set('display_errors',"1");
$UID = $_GET['UID'];
$path = scandir('./images/'.$UID);
?>
My OLD js to works with the images
<div id ="drop-box-overlay"></div>
document.getElementById("drop-box-overlay").addEventListener("drop",onDrop, false);
function onDrop(evt) {
var files = evt.dataTransfer.files;
}
//files is used in others functions but keep this format.
I want to retrieve var file
by my PHP function. Is it possible ?