Мой код js:
fetch(img).then(response => response.blob()) //img is canvas with method toBlob('image/png')
.then(blob => {
console.log(blob)
const fd = new FormData();
fd.append("fileName", blob, "file.ext");
return fetch("/sendImg", {
method: "POST",
fd
})
})
.then(response => response.ok)
.then(res => console.log(res))
.catch(err => console.log(err));
Symfony не работает ни с какими вещами:
$_REQUEST['fileName']) || isset($_FILES['fileName']) || $request->files->get('fileName')