this is the resource I found
http://jsfiddle.net/qF7Ff/
what I"m doing now is to use js"s filereader to generate every base64 address
, each predicted to be an input name=icon []
, and then to download each video
, so it will be < input name= "icon []" type= "hidden" value= https://img.codeshelper.com/upload/img/2021/04/01/uwookwllll214688 >
foreach ($_POST["icon"] as $key => $value) {
preg_match("/^(data:\s*image\/(\w+);base64,)/", $value, $result);
$file_ext = ".".$result[2];
$file_name = $first["prod_id"]."-".md5(rand());
file_put_contents("../../images/product/".$file_name.$file_ext, base64_decode(str_replace($result[1], "", $value)));
the resource I found is always uploaded, except that every object it produces is
so how can I download these videos at the back of my server?
what changes does ajax need to do to respond?
ajax
var formData = new FormData($("-sharpform")[0]);
$.ajax({
type: "POST",
url: "xxx",
data: formData,
enctype: "multipart/form-data",
cache: false,
contentType: false,
processData: false,